@@ -43,7 +43,7 @@ public class EventFlowOptions
4343
4444 private readonly ConcurrentBag < Type > _aggregateEventTypes = new ConcurrentBag < Type > ( ) ;
4545 private readonly EventFlowConfiguration _eventFlowConfiguration = new EventFlowConfiguration ( ) ;
46- private Lazy < IRegistrationFactory > _lazyRegistrationFactory = new Lazy < IRegistrationFactory > ( ( ) => new AutofacRegistrationFactory ( ) ) ;
46+ private Lazy < IServiceRegistration > _lazyRegistrationFactory = new Lazy < IServiceRegistration > ( ( ) => new AutofacServiceRegistration ( ) ) ;
4747
4848 private EventFlowOptions ( ) { }
4949
@@ -70,20 +70,20 @@ public EventFlowOptions AddEvents(IEnumerable<Type> aggregateEventTypes)
7070 return this ;
7171 }
7272
73- public EventFlowOptions Register ( Action < IRegistrationFactory > register )
73+ public EventFlowOptions Register ( Action < IServiceRegistration > register )
7474 {
7575 register ( _lazyRegistrationFactory . Value ) ;
7676 return this ;
7777 }
7878
79- public EventFlowOptions UseRegistrationFactory ( IRegistrationFactory registrationFactory )
79+ public EventFlowOptions UseServiceRegistration ( IServiceRegistration serviceRegistration )
8080 {
8181 if ( _lazyRegistrationFactory . IsValueCreated )
8282 {
8383 throw new InvalidOperationException ( "Registration factory is already in use" ) ;
8484 }
8585
86- _lazyRegistrationFactory = new Lazy < IRegistrationFactory > ( ( ) => registrationFactory ) ;
86+ _lazyRegistrationFactory = new Lazy < IServiceRegistration > ( ( ) => serviceRegistration ) ;
8787 return this ;
8888 }
8989
@@ -104,7 +104,7 @@ public IRootResolver CreateResolver(bool validateRegistrations = true)
104104 RegisterIfMissing < IDispatchToEventSubscribers , DispatchToEventSubscribers > ( services ) ;
105105 RegisterIfMissing < IDomainEventFactory , DomainEventFactory > ( services , Lifetime . Singleton ) ;
106106 RegisterIfMissing < IEventCache , InMemoryEventCache > ( services , Lifetime . Singleton ) ;
107- RegisterIfMissing < IEventFlowConfiguration > ( services , f => f . AddRegistration < IEventFlowConfiguration > ( _ => _eventFlowConfiguration ) ) ;
107+ RegisterIfMissing < IEventFlowConfiguration > ( services , f => f . Register < IEventFlowConfiguration > ( _ => _eventFlowConfiguration ) ) ;
108108
109109 var rootResolver = _lazyRegistrationFactory . Value . CreateResolver ( validateRegistrations ) ;
110110
@@ -118,10 +118,10 @@ private void RegisterIfMissing<TService, TImplementation>(ICollection<Type> regi
118118 where TService : class
119119 where TImplementation : class , TService
120120 {
121- RegisterIfMissing < ILog > ( registeredServices , f => f . AddRegistration < TService , TImplementation > ( lifetime ) ) ;
121+ RegisterIfMissing < ILog > ( registeredServices , f => f . Register < TService , TImplementation > ( lifetime ) ) ;
122122 }
123123
124- private void RegisterIfMissing < TService > ( ICollection < Type > registeredServices , Action < IRegistrationFactory > register )
124+ private void RegisterIfMissing < TService > ( ICollection < Type > registeredServices , Action < IServiceRegistration > register )
125125 {
126126 if ( registeredServices . Contains ( typeof ( TService ) ) )
127127 {
0 commit comments