public IAggregateProcessor Create(IMetadataElement metadata) { var aggregateMetadata = (AggregateMetadata <TAggregate, long>)metadata; return(new AggregateProcessor <TAggregate, long>( new DataChangesDetector <TAggregate>(aggregateMetadata.MapSpecificationProviderForSource, aggregateMetadata.MapSpecificationProviderForTarget, _comparerFactory.CreateIdentityComparer <TAggregate>(), _query), _repositoryFactory.Create <TAggregate>(), metadata.Elements.OfType <IValueObjectMetadata>().Select(x => CreateFactory(x).Create(x)).ToArray(), new AggregateFindSpecificationProvider <TAggregate, long>(new DefaultIdentityProvider()))); }
public IFactProcessor Create(IMetadataElement metadata) { var factMetadata = (FactMetadata <TFact>)metadata; var changesDetector = new DataChangesDetector <TFact>(factMetadata.MapSpecificationProviderForSource, factMetadata.MapSpecificationProviderForTarget, _comparerFactory.CreateIdentityComparer <TFact>(), _query); var dependencyProcessors = factMetadata.Features.OfType <IFactDependencyFeature>().Select(this.Create).ToArray(); return(new FactProcessor <TFact>(changesDetector, _repository, dependencyProcessors, new DefaultIdentityProvider())); }