Class ReducerTypeExtensions
Extension methods for working with reducer types.
public static class ReducerTypeExtensions
- Inheritance
-
ReducerTypeExtensions
- Inherited Members
Methods
GetEventSequenceId(Type)
Get the event sequence id for a reducer type.
public static EventSequenceId GetEventSequenceId(this Type type)
Parameters
Returns
- EventSequenceId
The EventSequenceId for the type.
GetReadModelType(Type)
Get the type of the read model for a reducer.
public static Type GetReadModelType(this Type type)
Parameters
type
TypeReducer type to get for.
Returns
- Type
Type of read model.
GetReducerId(Type)
Get the reducer id for a type.
public static ReducerId GetReducerId(this Type type)
Parameters
Returns
IsActive(Type)
Get whether a reducer is active.
public static bool IsActive(this Type type)
Parameters
Returns
- bool
True if it is, false if not.
IsReducerMethod(MethodInfo, Type, IEnumerable<Type>)
Check if a MethodInfo is a reducer method.
public static bool IsReducerMethod(this MethodInfo methodInfo, Type readModelType, IEnumerable<Type> eventTypes)
Parameters
methodInfo
MethodInfoMethodInfo to check.
readModelType
TypeType of read model.
eventTypes
IEnumerable<Type>Known event types in the process.
Returns
- bool
True if it is a reducer method, false if not.
Remarks
The following are considered valid reducer method signatures.
Task<TReadModel> {MethodName}(TEvent event, TReadModel? initial, EventContext context) Task<TReadModel> {MethodName}(TEvent event, TReadModel? initial) TReadModel {MethodName}(TEvent event, TReadModel? current, EventContext context) TReadModel {MethodName}(TEvent event, TReadModel? current)