This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class TaskEx | |
| { | |
| public static async Task<(T1, T2)> WhenAll<T1, T2>(Task<T1> task1, Task<T2> task2) | |
| { | |
| await Task.WhenAll(task1, task2); | |
| return (task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult()); | |
| } | |
| public static async Task<(T1, T2, T3)> WhenAll<T1, T2, T3>(Task<T1> task1, Task<T2> task2, Task<T3> task3) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class CustomJsonSerializerOptions | |
| { | |
| public static readonly JsonSerializerOptions Options = new() { | |
| PropertyNamingPolicy = new SnakeCaseJsonNamingPolicy(), | |
| PropertyNameCaseInsensitive = true, | |
| DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, | |
| Converters = { | |
| new JsonStringEnumConverter (new SnakeCaseJsonNamingPolicy()), | |
| // Other converters | |
| } |
OlderNewer