2 ms·
Well, you can put it into an extension method like this: T SyncResult<T>(this Task<T> task){ return task.ConfigureAwait(false).Result; } Same for ValueTask.
by torginus 5y ago
Well, you can put it into an extension method like this:
T SyncResult<T>(this Task<T> task){
return task.ConfigureAwait(false).Result;
}
Same for ValueTask. It may already be implemented in the base .NET library as well.