コード例 #1
0
 public UserProjection(
     IEventRepository eventRepository,
     IEventListener eventListener,
     IQueryModelRepository queryModelRepository,
     IProjectionMetadataRepository projectionMetadataRepository) : base(ProjectionId, eventRepository, eventListener, queryModelRepository, projectionMetadataRepository)
 {
     projectionMetadataRepository.InitializeProjection(ProjectionId, this.GetType().Name);
 }
コード例 #2
0
        protected Projection(
            Guid projectionId,
            IEventRepository eventRepository,
            IEventListener eventListener,
            IQueryModelRepository queryModelRepository,
            IProjectionMetadataRepository projectionMetadataRepository)
        {
            _projectionId = projectionId;

            _eventRepository              = eventRepository ?? throw new ArgumentNullException(nameof(eventRepository));
            _eventListener                = eventListener ?? throw new ArgumentNullException(nameof(eventListener));
            QueryModelRepository          = queryModelRepository ?? throw new ArgumentNullException(nameof(queryModelRepository));
            _projectionMetadataRepository = projectionMetadataRepository ?? throw new ArgumentNullException(nameof(projectionMetadataRepository));

            _eventHandlers = new Dictionary <Type, Func <object, QueryModelStore, Task> >();
        }
コード例 #3
0
        public QueryModelStore(
            IQueryModelRepository queryModelRepository,
            IProjectionMetadataRepository projectionMetadataRepository,
            long eventOffset,
            Guid projectionId)
        {
            if (queryModelRepository == null)
            {
                throw new ArgumentNullException(nameof(queryModelRepository));
            }
            if (projectionMetadataRepository == null)
            {
                throw new ArgumentNullException(nameof(projectionMetadataRepository));
            }

            _queryModelRepository         = queryModelRepository;
            _projectionMetadataRepository = projectionMetadataRepository;

            _eventOffset  = eventOffset;
            _projectionId = projectionId;
        }