using System.Reflection;
using Tapeti.Config;
namespace Tapeti.Flow.Default
{
///
/// Default implementation for IFlowHandlerContext
///
internal class FlowHandlerContext : IFlowHandlerContext
{
///
///
public FlowHandlerContext(ITapetiConfig config, object? controller, MethodInfo method)
{
Config = config;
Controller = controller;
Method = method;
}
///
///
public FlowHandlerContext(IMessageContext source)
{
var controllerPayload = source.Get();
Config = source.Config;
Controller = controllerPayload.Controller;
Method = controllerPayload.Binding.Method;
MessageContext = source;
}
///
public void Dispose()
{
}
///
public ITapetiConfig Config { get; }
///
public object? Controller { get; }
///
public MethodInfo Method { get; }
///
public IMessageContext? MessageContext { get; }
}
}