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