1
0
mirror of synced 2024-07-01 08:17:39 +00:00
Tapeti/Tapeti.Flow/Default/FlowHandlerContext.cs

52 lines
1.2 KiB
C#
Raw Normal View History

using System.Reflection;
2019-08-15 10:04:03 +00:00
using Tapeti.Config;
namespace Tapeti.Flow.Default
{
/// <summary>
/// Default implementation for IFlowHandlerContext
/// </summary>
internal class FlowHandlerContext : IFlowHandlerContext
{
/// <summary>
/// </summary>
public FlowHandlerContext(ITapetiConfig config, object? controller, MethodInfo method)
2019-08-15 10:04:03 +00:00
{
Config = config;
Controller = controller;
Method = method;
2019-08-15 10:04:03 +00:00
}
/// <summary>
/// </summary>
public FlowHandlerContext(IMessageContext source)
2019-08-15 10:04:03 +00:00
{
var controllerPayload = source.Get<ControllerMessageContextPayload>();
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; }
2019-08-15 10:04:03 +00:00
/// <inheritdoc />
public object? Controller { get; }
2019-08-15 10:04:03 +00:00
/// <inheritdoc />
public MethodInfo Method { get; }
2019-08-15 10:04:03 +00:00
/// <inheritdoc />
public IMessageContext? MessageContext { get; }
2019-08-15 10:04:03 +00:00
}
}