I have func<Task>
delegates in my project which can be null. Is there any way to make the call of such a delegate simpler as displayed below?
public async Task Test()
{
Func<Task> funcWithTask = null;
await (funcWithTask != null ? funcWithTask.Invoke() : Task.CompletedTask);
}
Func<Task> funcWithTask = () => Task.CompletedTask;
– Puparium