Class EventStreamAttribute<TSource>
- Namespace
- Cratis.Chronicle.ReadModels
- Assembly
- Cratis.Chronicle.dll
Declares a source-keyed read model whose state is folded from one event stream.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
public sealed class EventStreamAttribute<TSource> : Attribute where TSource : IEventSource
Type Parameters
TSourceThe event source definition declaring the stream.
- Inheritance
-
EventStreamAttribute<TSource>
- Inherited Members
- Extension Methods
Remarks
The model is implicitly passive. Reads must supply a stream scope. The definition's event source type filters both the fold and its guard; events written without that source type are not included.
Constructors
EventStreamAttribute(string)
Declares a source-keyed read model whose state is folded from one event stream.
public EventStreamAttribute(string stream)
Parameters
streamstringThe declared stream name.
Remarks
The model is implicitly passive. Reads must supply a stream scope. The definition's event source type filters both the fold and its guard; events written without that source type are not included.
Properties
EventSource
Gets the event source definition type.
public Type EventSource { get; }
Property Value
Stream
Gets the declared stream name.
public string Stream { get; }