namespace Connected.Services; public abstract class ServiceFunction : ServiceOperation, IFunction where TArgs : IDto { protected TReturnValue Result { get; private set; } = default!; public async Task Invoke(TArgs args) { if (args is null) throw new ArgumentException(null, nameof(args)); Arguments = args; Result = await OnInvoke(); return Result; } protected abstract Task OnInvoke(); }