Class TieredStorageServiceCollectionExtensions
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- Excalibur.EventSourcing.dll
Extension methods for configuring tiered event storage on IEventSourcingBuilder.
public static class TieredStorageServiceCollectionExtensions
- Inheritance
-
TieredStorageServiceCollectionExtensions
- Inherited Members
Methods
UseTieredStorage(IEventSourcingBuilder, IConfiguration)
Enables tiered event storage with hot/cold separation, with options bound from an IConfiguration section.
[UnconditionalSuppressMessage("AOT", "IL2026:RequiresUnreferencedCode", Justification = "Options validation/binding uses reflection by design. AOT consumers should use source-generated alternatives.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "Configuration binding uses reflection by design. AOT consumers should use source-generated alternatives.")]
public static IEventSourcingBuilder UseTieredStorage(this IEventSourcingBuilder builder, IConfiguration configuration)
Parameters
builderIEventSourcingBuilderThe event sourcing builder.
configurationIConfigurationThe configuration section to bind ArchivePolicy from.
Returns
- IEventSourcingBuilder
The builder for fluent chaining.
Remarks
This overload binds options from configuration (e.g., appsettings.json) instead of
an imperative Action<T> delegate. Data annotations are validated on start.
Consumers must also register an IColdEventStore implementation (e.g., Azure Blob, S3, or GCS provider).
UseTieredStorage(IEventSourcingBuilder, Action<ArchivePolicy>)
Enables tiered event storage with hot/cold separation.
public static IEventSourcingBuilder UseTieredStorage(this IEventSourcingBuilder builder, Action<ArchivePolicy> configure)
Parameters
builderIEventSourcingBuilderThe event sourcing builder.
configureAction<ArchivePolicy>Action to configure the archive policy.
Returns
- IEventSourcingBuilder
The builder for fluent chaining.
Remarks
When enabled, the IEventStore is wrapped with a
TieredEventStoreDecorator that transparently reads through to
IColdEventStore when events are missing from the hot tier.
Consumers must also register an IColdEventStore implementation (e.g., Azure Blob, S3, or GCS provider).