Example #1
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventStore"/>
 /// </summary>
 /// <param name="configuration"><see cref="EventStoreConfiguration"/> to use as configuration</param>
 /// <param name="applicationResources"><see cref="IApplicationResources"/> for working with <see cref="IApplicationResource">application resources</see></param>
 /// <param name="applicationResourceIdentifierConverter"><see cref="IApplicationResourceIdentifierConverter"/> for working with conversion of <see cref="IApplicationResourceIdentifier"/></param>
 /// <param name="applicationResourceResolver"><see cref="IApplicationResourceResolver"/> for resolving <see cref="IApplicationResourceIdentifier"/> to concrete types</param>
 /// <param name="eventEnvelopes"><see cref="IEventEnvelopes"/> for working with <see cref="EventEnvelope"/></param>
 /// <param name="serializer"><see cref="ISerializer"/> to use for serialization</param>
 public EventStore(
     EventStoreConfiguration configuration,
     IApplicationResources applicationResources,
     IApplicationResourceIdentifierConverter applicationResourceIdentifierConverter,
     IApplicationResourceResolver applicationResourceResolver,
     IEventEnvelopes eventEnvelopes,
     ISerializer serializer)
 {
     _configuration        = configuration;
     _eventEnvelopes       = eventEnvelopes;
     _applicationResources = applicationResources;
     _applicationResourceIdentifierConverter = applicationResourceIdentifierConverter;
     _applicationResourceResolver            = applicationResourceResolver;
     _serializer = serializer;
 }
        /// <summary>
        /// Configures the <see cref="IEventStore"/>
        /// </summary>
        /// <param name="eventsConfiguration"><see cref="IEventsConfiguration"/> to configure</param>
        /// <param name="path">Path to where the event store should live</param>
        /// <returns>Chained <see cref="IConfigure"/> for fluent configuration</returns>
        public static IConfigure UsingFiles(this IEventsConfiguration eventsConfiguration, string path)
        {
            eventsConfiguration.EventStoreType = typeof(EventStore);
            eventsConfiguration.EventSubscriptionsType = typeof(EventSubscriptions);
            eventsConfiguration.UncommittedEventStreamCoordinatorType = typeof(UncommittedEventStreamCoordinator);

            if (!Path.IsPathRooted(path))
                path = Path.Combine(Directory.GetCurrentDirectory(), path);

            var configuration = new EventStoreConfiguration
            {
                Path = path
            };
            Configure.Instance.Container.Bind<EventStoreConfiguration>(configuration);

            return Configure.Instance;
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventStore"/>
 /// </summary>
 /// <param name="configuration"><see cref="EventStoreConfiguration"/> to use as configuration</param>
 /// <param name="applicationResources"><see cref="IApplicationResources"/> for working with <see cref="IApplicationResource">application resources</see></param>
 /// <param name="applicationResourceIdentifierConverter"><see cref="IApplicationResourceIdentifierConverter"/> for working with conversion of <see cref="IApplicationResourceIdentifier"/></param>
 /// <param name="applicationResourceResolver"><see cref="IApplicationResourceResolver"/> for resolving <see cref="IApplicationResourceIdentifier"/> to concrete types</param>
 /// <param name="eventEnvelopes"><see cref="IEventEnvelopes"/> for working with <see cref="EventEnvelope"/></param>
 /// <param name="serializer"><see cref="ISerializer"/> to use for serialization</param>
 /// <param name="files"><see cref="IFiles"/> to work with files</param>
 /// <param name="logger"><see cref="ILogger"/> for logging</param>
 public EventStore(
     EventStoreConfiguration configuration,
     IApplicationResources applicationResources,
     IApplicationResourceIdentifierConverter applicationResourceIdentifierConverter,
     IApplicationResourceResolver applicationResourceResolver,
     IEventEnvelopes eventEnvelopes,
     ISerializer serializer,
     IFiles files,
     ILogger logger)
 {
     logger.Information($"Using path : {configuration.Path}");
     _configuration        = configuration;
     _eventEnvelopes       = eventEnvelopes;
     _applicationResources = applicationResources;
     _applicationResourceIdentifierConverter = applicationResourceIdentifierConverter;
     _applicationResourceResolver            = applicationResourceResolver;
     _serializer = serializer;
     _files      = files;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventSubscriptions"/>
 /// </summary>
 /// <param name="configuration"><see cref="EventStoreConfiguration"/> to use for configuration</param>
 /// <param name="serializer"><see cref="ISerializer"/> to use for serialization</param>
 public EventSubscriptions(EventStoreConfiguration configuration, ISerializer serializer)
 {
     _configuration = configuration;
     _serializer = serializer;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventSubscriptions"/>
 /// </summary>
 /// <param name="configuration"><see cref="EventStoreConfiguration"/> to use for configuration</param>
 /// <param name="serializer"><see cref="ISerializer"/> to use for serialization</param>
 public EventSubscriptions(EventStoreConfiguration configuration, ISerializer serializer)
 {
     _configuration = configuration;
     _serializer    = serializer;
 }