2016-11-21 19:54:29 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using Tapeti.Annotations;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti
|
|
|
|
|
{
|
|
|
|
|
public static class TapetiConnectionExtensions
|
|
|
|
|
{
|
|
|
|
|
public static TapetiConnection RegisterAllControllers(this TapetiConnection connection, Assembly assembly)
|
|
|
|
|
{
|
2016-12-05 07:00:09 +00:00
|
|
|
|
foreach (var type in assembly.GetTypes().Where(t => t.IsDefined(typeof(DynamicQueueAttribute))))
|
2016-11-21 19:54:29 +00:00
|
|
|
|
connection.RegisterController(type);
|
|
|
|
|
|
|
|
|
|
return connection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static TapetiConnection RegisterAllControllers(this TapetiConnection connection)
|
|
|
|
|
{
|
|
|
|
|
return RegisterAllControllers(connection, Assembly.GetCallingAssembly());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|