迁移部分方法到 TaskExtensions
This commit is contained in:
1 parent
1a639fa88f
commit
6a6b43fe9a
4 files changed
+13
-6
No files matched your search
@@ -0,0 +1,10 @@
|
||||
namespace MeloongCore.Extensions;
|
||||
public static class TaskExtensions {
|
||||
|
||||
public static void Run(this Task task) => task.GetAwaiter().GetResult();
|
||||
public static T Run<T>(this Task<T> task) => task.GetAwaiter().GetResult();
|
||||
|
||||
public static ConfiguredTaskAwaitable NoCapture(this Task task) => task.ConfigureAwait(false);
|
||||
public static ConfiguredTaskAwaitable<T> NoCapture<T>(this Task<T> task) => task.ConfigureAwait(false);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user