11using Autofac ;
22using System ;
3- using System . Collections . Generic ;
43using System . Linq ;
54using System . Reflection ;
65using Xer . Cqrs . CommandStack ;
@@ -19,23 +18,13 @@ internal CqrsCommandHandlerSelector(ContainerBuilder builder)
1918 {
2019 _builder = builder ;
2120 }
22-
23- public ICqrsCommandHandlerSelector ByInterface ( Assembly assembly )
24- {
25- return ByInterface ( assembly , Lifetime . PerDependency ) ;
26- }
27-
28- public ICqrsCommandHandlerSelector ByInterface ( Assembly assembly , Lifetime lifetime )
29- {
30- return ByInterface ( new [ ] { assembly } , lifetime ) ;
31- }
32-
33- public ICqrsCommandHandlerSelector ByInterface ( IEnumerable < Assembly > assemblies )
21+
22+ public ICqrsCommandHandlerSelector ByInterface ( params Assembly [ ] assemblies )
3423 {
35- return ByInterface ( assemblies , Lifetime . PerDependency ) ;
24+ return ByInterface ( Lifetime . PerDependency ) ;
3625 }
3726
38- public ICqrsCommandHandlerSelector ByInterface ( IEnumerable < Assembly > assemblies , Lifetime lifetime )
27+ public ICqrsCommandHandlerSelector ByInterface ( Lifetime lifetime , params Assembly [ ] assemblies )
3928 {
4029 if ( assemblies == null )
4130 {
@@ -77,23 +66,13 @@ public ICqrsCommandHandlerSelector ByInterface(IEnumerable<Assembly> assemblies,
7766
7867 return this ;
7968 }
80-
81- public ICqrsCommandHandlerSelector ByAttribute ( Assembly assembly )
82- {
83- return ByAttribute ( assembly , Lifetime . PerDependency ) ;
84- }
85-
86- public ICqrsCommandHandlerSelector ByAttribute ( Assembly assembly , Lifetime lifetime )
87- {
88- return ByAttribute ( new [ ] { assembly } , lifetime ) ;
89- }
90-
91- public ICqrsCommandHandlerSelector ByAttribute ( IEnumerable < Assembly > assemblies )
69+
70+ public ICqrsCommandHandlerSelector ByAttribute ( params Assembly [ ] assemblies )
9271 {
93- return ByAttribute ( assemblies , Lifetime . PerDependency ) ;
72+ return ByAttribute ( Lifetime . PerDependency , assemblies ) ;
9473 }
9574
96- public ICqrsCommandHandlerSelector ByAttribute ( IEnumerable < Assembly > assemblies , Lifetime lifetime )
75+ public ICqrsCommandHandlerSelector ByAttribute ( Lifetime lifetime , params Assembly [ ] assemblies )
9776 {
9877 if ( assemblies == null )
9978 {
0 commit comments