Passing information between Handlers in the Pipeline
public class MyContextAwareCommandHandler : RequestHandler<MyCommand>
{
public static string TestString { get; set; }
public override MyCommand Handle(MyCommand command)
{
LogContext();
return base.Handle(command);
}
private void LogContext()
{
TestString = (string)Context.Bag["TestString"];
Context.Bag["MyContextAwareCommandHandler"] = "I was called and set the context";
}
}Last updated
Was this helpful?
