예제 #1
0
 public static async Task <T> ReadJsonAsync <T>(this IBlobReader reader, string path, JsonSerializer serializer, CancellationToken cancellationToken = default)
 {
     using (var jsonReader = new JsonTextReader(new StreamReader(await reader.OpenReadAsync(path, cancellationToken).ConfigureAwait(false))))
     {
         return(serializer.Deserialize <T>(jsonReader));
     }
 }
예제 #2
0
 public static async Task <string> ReadAllTextAsync(this IBlobReader reader, string path, CancellationToken cancellationToken = default)
 {
     using (var streamReader = new StreamReader(await reader.OpenReadAsync(path, cancellationToken).ConfigureAwait(false)))
     {
         return(await streamReader.ReadToEndAsync().ConfigureAwait(false));
     }
 }