Skip to content

Commit

Permalink
feat: update ToTask<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Mar 14, 2024
1 parent 444060c commit 0c5827c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/WeihanLi.Common/Helpers/TaskHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static Task<T> ToTask<T>(object? obj, T defaultValue = default)
Task<T> t => t,
ValueTask vt0 => vt0.AsTask().ContinueWith(_ => defaultValue),
Task t0 => t0.ContinueWith(_ => defaultValue),
T v => Task.FromResult(v),
_ => Task.FromResult(defaultValue)
};
return task;
Expand Down

0 comments on commit 0c5827c

Please sign in to comment.