public static async Task WriteJsonAsync <T>(this IBlobWriter writer, string path, T value, JsonSerializer serializer, CancellationToken cancellationToken = default) { using (var jsonWriter = new JsonTextWriter(new StreamWriter(await writer.OpenWriteAsync(path, cancellationToken).ConfigureAwait(false)))) { serializer.Serialize(jsonWriter, value); } }
public static async Task WriteAllTextAsync(this IBlobWriter writer, string path, string value, CancellationToken cancellationToken = default) { using (var streamWriter = new StreamWriter(await writer.OpenWriteAsync(path, cancellationToken).ConfigureAwait(false))) { await streamWriter.WriteAsync(value).ConfigureAwait(false); } }