public InMemoryEventStoreSession(IHoldAllConfiguration configuration, Dictionary <TId, ItemWithType[]> data, TId id) : base(configuration) { this.data = data ?? throw new ArgumentNullException(nameof(data)); initialVersion = data[id].Length; this.id = id; }
public InMemoryEventStoreSession(IHoldAllConfiguration configuration, List <ItemWithType> stream, TId id) : base(configuration) { this.stream = stream ?? throw new ArgumentNullException(nameof(stream)); initialVersion = stream.Count; Id = id; }
public EventStoreRepository(IValidateState <TState> stateValidator, IHoldAllConfiguration configs, IEventStoreConnection connection, IDateTimeProvider dateTimeProvider = null) { this.stateValidator = stateValidator ?? throw new ArgumentNullException(nameof(stateValidator)); this.configs = configs ?? throw new ArgumentNullException(nameof(connection)); this.connection = connection ?? throw new ArgumentNullException(nameof(connection)); this.dateTimeProvider = dateTimeProvider ?? new SystemDateTimeProvider(); }
public EventStoreSession(IHoldAllConfiguration configuration, IEventStoreConnection eventStoreConnection, string streamName, IDateTimeProvider dateTimeProvider = null) : this(defaultValidator, configuration, eventStoreConnection, streamName, dateTimeProvider) { }
public EventStoreReadOnlyRepository(IHoldAllConfiguration configs, EventStoreClient esClient) { new EventStoreClient(EventStoreClientSettings.Create("esdb://localhost:2113?tls=false")); this.configs = configs ?? throw new ArgumentNullException(nameof(configs)); reader = new EventReader(esClient, configs); }
} = 1024; //4095 is max allowed value public EventStoreSession(IHoldAllConfiguration configuration, IEventStoreConnection eventStoreConnection, string streamName) : base(configuration) { this.eventStoreConnection = eventStoreConnection ?? throw new ArgumentNullException(nameof(eventStoreConnection)); this.streamName = streamName ?? throw new ArgumentNullException(nameof(streamName)); }
public EventStoreRepository(IValidateState <TState> stateValidator, IHoldAllConfiguration configs, EventStoreClient client, IDateTimeProvider dateTimeProvider = null) { this.stateValidator = stateValidator ?? throw new ArgumentNullException(nameof(stateValidator)); this.configs = configs ?? throw new ArgumentNullException(nameof(configs)); this.eventReader = new EventReader(client, configs); this.client = client ?? throw new ArgumentNullException(nameof(client)); this.dateTimeProvider = dateTimeProvider ?? new SystemDateTimeProvider(); }
public void Setup(IHoldAllConfiguration configuration) { if (repository != null) { throw new Exception($"{nameof(repository)} already setup"); } repository = new InMemoryEventSourcedRepository <string, IHoldHigherOrder>(configuration); }
public EventStoreSession ( IHoldAllConfiguration configuration, IReadEventsFromStream eventReader, IStoreEventsToStream eventWriter, string streamName, IDateTimeProvider dateTimeProvider = null ) : this(defaultValidator, configuration, eventReader, eventWriter, streamName, dateTimeProvider) { }
public static void SetupNode() { configuration = Configuration.Begin() .WithDefaultCollection() .WithDefaultStateFactory() .NeverUseThreadSafe() .WithNoEventPublisher() .WithAnyAppliersFrom(Assembly.GetExecutingAssembly()) .AndNoMoreAppliers() .WithNoUpconverters() .Build(); }
public EventStoreSession(IValidateState <TState> stateValidator, IHoldAllConfiguration configuration, IEventStoreConnection eventStoreConnection, string streamName) : base(stateValidator, configuration) { this.eventStoreConnection = eventStoreConnection ?? throw new ArgumentNullException(nameof(eventStoreConnection)); this.streamName = streamName ?? throw new ArgumentNullException(nameof(streamName)); this.eventReader = new EventReader(eventStoreConnection, configuration); }
public EntityFrameworkSession(IHoldAllConfiguration configuration, DbContext dbContext, DbSet <TState> set, bool isNew, bool useStateImmutabilityWrapping = true) : base(configuration, dbContext) { this.isNew = isNew; this.set = set; this.dbContext = dbContext; this.useStateImmutabilityWrapping = useStateImmutabilityWrapping; }
public ConfigurationSetup(IObjectContainer objectContainer) { this.objectContainer = objectContainer; configuration = Configuration.Begin() .WithDefaultCollection() .WithDefaultStateFactory() .NeverUseThreadSafe() .WithNoEventPublisher() .WithAnyAppliersFrom(Assembly.GetExecutingAssembly()) .AndNoMoreAppliers() .WithNoUpconverters() .Build(); }
public EventStoreSession(IValidateState <TState> stateValidator, IHoldAllConfiguration configuration, EventStoreClient eventStoreClientclient, string streamName, IDateTimeProvider dateTimeProvider = null) : base(stateValidator, configuration) { this.client = eventStoreClientclient ?? throw new ArgumentNullException(nameof(eventStoreClientclient)); this.streamName = streamName ?? throw new ArgumentNullException(nameof(streamName)); this.dateTimeProvider = dateTimeProvider ?? new SystemDateTimeProvider(); this.eventReader = new EventReader(client, configuration); }
protected BaseRepoSession(IHoldAllConfiguration configuration, IDisposable disposableHandle) { this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); this.disposableHandle = disposableHandle; NewEventsCollection = configuration.CollectionTypeSelector(stateType)(); currentState = default(TState); this.eventPublisher = configuration.EventPublisher; EventApplier = this.configuration.EventApplier; }
public EventStoreSession ( IValidateState <TState> stateValidator, IHoldAllConfiguration configuration, IReadEventsFromStream eventReader, IStoreEventsToStream eventWriter, string streamName, IDateTimeProvider dateTimeProvider = null ) : base(stateValidator, configuration) { this.eventReader = eventReader ?? throw new ArgumentNullException(nameof(eventReader)); this.eventWriter = eventWriter ?? throw new ArgumentNullException(nameof(eventWriter)); this.streamName = streamName ?? throw new ArgumentNullException(nameof(streamName)); this.dateTimeProvider = dateTimeProvider ?? new SystemDateTimeProvider(); }
private async Task PublishEvents(IHoldAllConfiguration configuration, ItemWithType[] events, CancellationToken cancellationToken = default(CancellationToken)) { bool hasInterceptors = configuration.HasInterceptors; ItemWithType @event; for (var i = 0; i < events.Length; i++) { @event = events[i]; TryCallInterceptor(hasInterceptors, configuration.Interceptors, @event, (interc, e, et, s, st) => interc.BeforePublish(e, et, s, st)); //We await each one to guarantee ordering of publishing, even though it would have been more performant // to publish and await all of them with a WhenAll await eventPublisher.Publish(events[i], cancellationToken); TryCallInterceptor(hasInterceptors, configuration.Interceptors, @event, (interc, e, et, s, st) => interc.AfterPublish(e, et, s, st)); } }
public BaseEventSourcedSession(IHoldAllConfiguration configuration, IDisposable disposableHandle = null) : base(configuration, disposableHandle) => eventApplier = configuration.EventApplier;
public EventReader(IEventStoreConnection connection, IHoldAllConfiguration configuration) { stateFactory = configuration?.StateFactory ?? throw new ArgumentNullException(nameof(configuration)); eventStoreConnection = connection ?? throw new ArgumentNullException(nameof(connection)); }
public NEventStoreSession(IHoldAllConfiguration configuration, IEventStream stream) : base(configuration) { eventStream = stream ?? throw new ArgumentNullException(nameof(stream)); }
public StubSession(IHoldAllConfiguration config, Action <string> onSave) : base(config, new MemoryStream()) => OnSave = onSave;
public StubRepo(IHoldAllConfiguration config, ConcurrentQueue <string> calls) { OnSave = calls.Enqueue; Configuration = config; }
protected BaseRepoSession(IHoldAllConfiguration configuration, IDisposable disposableHandle) : this(new AlwaysPassValidator <TState>(), configuration, disposableHandle) { }
public EventStoreReadOnlyRepository(IHoldAllConfiguration configs, IEventStoreConnection connection) { this.configs = configs ?? throw new ArgumentNullException(nameof(connection)); reader = new EventReader(connection, configs); }
public EventStoreRepository(IHoldAllConfiguration configs, IEventStoreConnection connection) { this.configs = configs ?? throw new ArgumentNullException(nameof(connection)); this.connection = connection ?? throw new ArgumentNullException(nameof(connection)); }
public TcpEventReader(IEventStoreConnection client, IHoldAllConfiguration configuration, int pageSize = 4096) { stateFactory = configuration?.StateFactory ?? throw new ArgumentNullException(nameof(configuration)); this.connection = client ?? throw new ArgumentNullException(nameof(client)); this.pageSize = pageSize; }
public BaseEventSourcedSession(IValidateState <TState> validator, IHoldAllConfiguration configuration, IDisposable disposableHandle = null) : base(validator, configuration, disposableHandle) => eventApplier = configuration.EventApplier;
public void SetupRepository(IHoldAllConfiguration configuration) { repository = new EventStoreRepository <string, IHoldHigherOrder>(configuration, GetConnection()); }
public EventStoreReadOnlyRepository(IHoldAllConfiguration configs, IReadEventsFromStream reader) { this.configs = configs ?? throw new ArgumentNullException(nameof(configs)); this.reader = reader; }
public static SerializationWireup WithSerializationForInterfaceMessages( this PersistenceWireup persistenceWireup, IHoldAllConfiguration configuration) => persistenceWireup.UsingCustomSerialization(new CustomSerializer(configuration));