You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
namespace Connected.Services.Middleware
|
|
|
|
|
{
|
|
|
|
|
public abstract class ActionMiddleware<TArgs> : ServiceMiddleware<TArgs>, IActionMiddleware<TArgs>
|
|
|
|
|
{
|
|
|
|
|
protected TArgs? Arguments { get; private set; }
|
|
|
|
|
public async Task Invoke(TArgs? args)
|
|
|
|
|
{
|
|
|
|
|
Arguments = args;
|
|
|
|
|
|
|
|
|
|
await OnValidate();
|
|
|
|
|
await OnInvoke();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual async Task OnInvoke()
|
|
|
|
|
{
|
|
|
|
|
await Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual async Task OnValidate()
|
|
|
|
|
{
|
|
|
|
|
await Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|