1
0
mirror of synced 2024-11-16 14:53:50 +00:00
Tapeti/Tapeti.Flow/Default/FlowHandlerContext.cs

54 lines
1.2 KiB
C#
Raw Permalink Normal View History

using System.Reflection;
2019-08-15 10:04:03 +00:00
using Tapeti.Config;
namespace Tapeti.Flow.Default
{
/// <inheritdoc />
/// <summary>
/// Default implementation for IFlowHandlerContext
/// </summary>
internal class FlowHandlerContext : IFlowHandlerContext
{
/// <summary>
/// </summary>
2019-08-15 10:04:03 +00:00
public FlowHandlerContext()
{
}
/// <summary>
/// </summary>
public FlowHandlerContext(IMessageContext source)
2019-08-15 10:04:03 +00:00
{
if (source == null)
return;
if (!source.TryGet<ControllerMessageContextPayload>(out var controllerPayload))
return;
2019-08-15 10:04:03 +00:00
Config = source.Config;
Controller = controllerPayload.Controller;
Method = controllerPayload.Binding.Method;
MessageContext = source;
2019-08-15 10:04:03 +00:00
}
/// <inheritdoc />
public void Dispose()
{
}
/// <inheritdoc />
public ITapetiConfig Config { get; set; }
/// <inheritdoc />
public object Controller { get; set; }
/// <inheritdoc />
public MethodInfo Method { get; set; }
/// <inheritdoc />
public IMessageContext MessageContext { get; set; }
2019-08-15 10:04:03 +00:00
}
}