Beispiel #1
0
        public EventStoreOrg(EventStoreConfiguration configuration, ILogger logger, ITypeLocator typeLocator)
        {
            _configuration = configuration;
            _logger        = logger;
            _typeLocator   = typeLocator;

            var jsonResolver = new PropertyCleanerSerializerContractResolver();

            jsonResolver.IgnoreProperty(typeof(IEvent), "Version");
            jsonResolver.RenameProperty(typeof(IEvent), "Id", "AggregateId");

            _serializerSettings = new JsonSerializerSettings {
                ContractResolver = jsonResolver,
                Formatting       = Formatting.Indented
            };
        }
        public EventsSubscription(long?initialPosition, IEnumerable <Type> eventTypes, DomainEventReceived domainEventReceived, LiveProcessingStarted liveProcessingStarted, ILogger logger)
        {
            _lastPosition          = initialPosition.HasValue ? new Position(initialPosition.Value, initialPosition.Value) : (Position?)null;
            _domainEventReceived   = domainEventReceived;
            _liveProcessingStarted = liveProcessingStarted;
            _logger          = logger;
            _nameToEventType = eventTypes.ToDictionary(x => x.Name);

            var jsonResolver = new PropertyCleanerSerializerContractResolver();

            jsonResolver.IgnoreProperty(typeof(IEvent), "Version");
            jsonResolver.RenameProperty(typeof(IEvent), "Id", "AggregateId");

            _serializerSettings = new JsonSerializerSettings {
                ContractResolver = jsonResolver,
                Formatting       = Formatting.Indented
            };
        }