I have the following function with a delegate parameter that accepts a type of one interface and returns a task of another.
public void Bar(Func
I am using another version of GeneralizeTask, which is stated by @Recursive, on Asp Net Core Framework. Here it is:
public static Task GeneralizeTask(this Task task, CancellationToken cancellationToken = default)
where TBase : class
where TDerived : TBase
{
var result = task.ContinueWith(t => (TBase)t.Result, cancellationToken);
return result;
}