Я пытаюсь использовать платформу EventFlow CQRS в веб-интерфейсе AspNetCore 2.1. Все работает нормально, но после регистрации ReadModelLocator код выдает исключение:
**Exception has occurred: CLR/System.AggregateException**
An exception of type 'System.AggregateException' occurred in EventFlow.dll but was not handled in user code: 'An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DomainEventPublisher (ReflectionActivator), Services = [EventFlow.Subscribers.DomainEventPublisher], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IReadStoreManager[] (DelegateActivator), Services = [System.Collections.Generic.IEnumerable`1[[EventFlow.ReadStores.IReadStoreManager, EventFlow, Version=0.67.3697.0, Culture=neutral, PublicKeyToken=null]]], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IReadStoreManager (DelegateActivator), Services = [EventFlow.ReadStores.IReadStoreManager], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = MultipleAggregateReadStoreManager`3 (ReflectionActivator), Services = [EventFlow.ReadStores.MultipleAggregateReadStoreManager`3[[EventFlow.ReadStores.InMemory.IInMemoryReadStore`1[[querymodel.endpoint.EndpointModel, query-model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], EventFlow, Version=0.67.3697.0, Culture=neutral, PublicKeyToken=null],[querymodel.endpoint.EndpointModel, query-model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[querymodel.endpoint.EndpointByCodeLocator, query-model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'EventFlow.ReadStores.MultipleAggregateReadStoreManager`3[EventFlow.ReadStores.InMemory.IInMemoryReadStore`1[querymodel.endpoint.EndpointModel],querymodel.endpoint.EndpointModel,querymodel.endpoint.EndpointByCodeLocator]' can be invoked with the available services and parameters:
Cannot resolve parameter 'querymodel.endpoint.EndpointByCodeLocator readModelLocator' of constructor 'Void .ctor(EventFlow.Logs.ILog, EventFlow.Configuration.IResolver, EventFlow.ReadStores.InMemory.IInMemoryReadStore`1[querymodel.endpoint.EndpointModel], EventFlow.ReadStores.IReadModelDomainEventApplier, querymodel.endpoint.EndpointByCodeLocator, EventFlow.ReadStores.IReadModelFactory`1[querymodel.endpoint.EndpointModel])'. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.), An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IDomainEventPublisher (DelegateActivator), Services = [EventFlow.Subscribers.IDomainEventPublisher], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DomainEventPublisher (ReflectionActivator), Services = [EventFlow.Subscribers.DomainEventPublisher], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IReadStoreManager[] (DelegateActivator), Services = [System.Collections.Generic.IEnumerable`1[[EventFlow.ReadStores.IReadStoreManager, EventFlow, Version=0.67.3697.0, Culture=neutral, PublicKeyToken=null]]], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IReadStoreManager (DelegateActivator), Services = [EventFlow.ReadStores.IReadStoreManager], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = MultipleAggregateReadStoreManager`3 (ReflectionActivator), Services = [EventFlow.ReadStores.MultipleAggregateReadStoreManager`3[[EventFlow.ReadStores.InMemory.IInMemoryReadStore`1[[querymodel.endpoint.EndpointModel, query-model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], EventFlow, Version=0.67.3697.0, Culture=neutral, PublicKeyToken=null],[querymodel.endpoint.EndpointModel, query-model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[querymodel.endpoint.EndpointByCodeLocator, query-model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'EventFlow.ReadStores.MultipleAggregateReadStoreManager`3[EventFlow.ReadStores.InMemory.IInMemoryReadStore`1[querymodel.endpoint.EndpointModel],querymodel.endpoint.EndpointModel,querymodel.endpoint.EndpointByCodeLocator]' can be invoked with the available services and parameters:
Cannot resolve parameter 'querymodel.endpoint.EndpointByCodeLocator readModelLocator' of constructor 'Void .ctor(EventFlow.Logs.ILog, EventFlow.Configuration.IResolver, EventFlow.ReadStores.InMemory.IInMemoryReadStore`1[querymodel.endpoint.EndpointModel], EventFlow.ReadStores.IReadModelDomainEventApplier, querymodel.endpoint.EndpointByCodeLocator, EventFlow.ReadStores.IReadModelFactory`1[querymodel.endpoint.EndpointModel])'
Я зарегистрировал все компоненты, как описано в примере:
var builder = new ContainerBuilder();
builder.Populate(services);
var container = EventFlowOptions.New
.UseAutofacContainerBuilder(builder)
.UseConsoleLog()
.UseFilesEventStore(FilesEventStoreConfiguration.Create("./evt-store"))
.AddDefaults(typeof(Endpoint).Assembly)
.AddDefaults(typeof(EndpointModel).Assembly)
.AddDefaults(typeof(CreateEndpointCommand).Assembly)
.UseInMemoryReadStoreFor<EndpointModel, EndpointByCodeLocator>()
.CreateContainer();
Есть идеи? THX!