Class EventSourcingBuilderInMemoryExtensions
- Namespace
- Excalibur.EventSourcing.InMemory
- Assembly
- Excalibur.EventSourcing.InMemory.dll
Extension methods for configuring in-memory event sourcing on IEventSourcingBuilder.
public static class EventSourcingBuilderInMemoryExtensions
- Inheritance
-
EventSourcingBuilderInMemoryExtensions
- Inherited Members
Remarks
These extensions provide fluent provider selection following the established builder pattern used by other InMemory provider packages.
Warning: The in-memory event store is intended for testing and development only. Data is lost when the process restarts.
Methods
UseInMemory(IEventSourcingBuilder)
Configures the event sourcing builder to use an in-memory event store.
public static IEventSourcingBuilder UseInMemory(this IEventSourcingBuilder builder)
Parameters
builderIEventSourcingBuilderThe event sourcing builder.
Returns
- IEventSourcingBuilder
The builder for fluent chaining.
Examples
services.AddExcalibur(x => x.AddEventSourcing(es =>
{
es.UseInMemory()
.AddRepository<OrderAggregate, Guid>();
}));
Exceptions
- ArgumentNullException
Thrown when
builderis null.
UseInMemory(IEventSourcingBuilder, Action<IInMemoryEventSourcingBuilder>?)
Configures the event sourcing builder to use an in-memory event store with optional in-memory-specific configuration.
public static IEventSourcingBuilder UseInMemory(this IEventSourcingBuilder builder, Action<IInMemoryEventSourcingBuilder>? configure)
Parameters
builderIEventSourcingBuilderThe event sourcing builder.
configureAction<IInMemoryEventSourcingBuilder>Optional action to configure in-memory-specific options.
Returns
- IEventSourcingBuilder
The builder for fluent chaining.
Examples
services.AddExcalibur(x => x.AddEventSourcing(es =>
{
es.UseInMemory(inmemory =>
{
inmemory.StoreName("test-store");
})
.AddRepository<OrderAggregate, Guid>();
}));
Exceptions
- ArgumentNullException
Thrown when
builderis null.