/// <summary> /// Initializes a new instance of the <see cref="RequestHandlerAttribute"/> class. /// </summary> /// <param name="step">The step.</param> /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the name of the handler)</param> /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param> /// <param name="timing">The timing.</param> /// <param name="onceOnlyAction">Action to take if prevent duplicate messages, and we receive a duplicate message</param> public UseInboxAttribute(int step, string contextKey = null, bool onceOnly = false, HandlerTiming timing = HandlerTiming.Before, OnceOnlyAction onceOnlyAction = OnceOnlyAction.Throw) : base(step, timing) { ContextKey = contextKey; OnceOnly = onceOnly; OnceOnlyAction = onceOnlyAction; }
/// <summary> /// Initializes a new instance of the <see cref="UseCommandSourcingAsyncAttribute"/> class. /// </summary> /// <param name="step">The step.</param> /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param> /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the name of the handler)</param> /// <param name="timing">The timing.</param> /// <param name="onceOnlyAction">Action to take if prevent duplicate messages, and we receive a duplicate message</param> public UseCommandSourcingAsyncAttribute(int step, bool onceOnly = false, string contextKey = null, HandlerTiming timing = HandlerTiming.Before, OnceOnlyAction onceOnlyAction = OnceOnlyAction.Throw) : base(step, timing) { OnceOnly = onceOnly; ContextKey = contextKey; OnceOnlyAction = onceOnlyAction; }
public override void InitializeFromAttributeParams(params object[] initializerList) { _onceOnly = (bool)initializerList[0]; _contextKey = (string)initializerList[1]; _onceOnlyAction = (OnceOnlyAction)initializerList[2]; base.InitializeFromAttributeParams(initializerList); }
public InboxConfiguration( InboxScope scope = InboxScope.All, bool onceOnly = true, OnceOnlyAction actionOnExists = OnceOnlyAction.Throw, Func <Type, string> context = null) { Scope = scope; Context = context; OnceOnly = onceOnly; ActionOnExists = actionOnExists; if (context == null) { Context = (handlerType) => handlerType.FullName; } }
/// <summary> /// Initializes a new instance of the <see cref="RequestHandlerAttribute"/> class. /// </summary> /// <param name="step">The step.</param> /// <param name="contextKey">An identifier for the context in which the command has been processed (for example, the type of the handler)</param> /// <param name="onceOnly">Should we prevent duplicate messages i.e. seen already</param> /// <param name="timing">The timing.</param> /// <param name="onceOnlyAction">Action to take if prevent duplicate messages, and we receive a duplicate message</param> public UseInboxAttribute(int step, Type contextKey, bool onceOnly = false, HandlerTiming timing = HandlerTiming.Before, OnceOnlyAction onceOnlyAction = OnceOnlyAction.Throw) : this(step, contextKey.FullName, onceOnly, timing, onceOnlyAction) { }