namespace Connected.Services.Middleware { public abstract class ActionMiddleware : ServiceMiddleware, IActionMiddleware { 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; } } }