Consider the following case:
class A { public int Id; } class B : A { } class Main { public async Task Create(Type type) {
The above solution really helped me. I made a small tweak to the @Lukazoid solution...
var resultProperty = typeof(Task<>).MakeGenericType(type).GetProperty("Result"); A a = (A)resultProperty.GetValue(task);
to
dynamic a = task.GetType().GetProperty("Result")?.GetValue(task);