public static async Task <IStorageRecord> CreateRecordAsync( this IStorageContainer storageContainer, string name, byte[] data, string contentType = null, IProgress progress = null, CancellationToken cancellationToken = default(CancellationToken)) { using (var buffer = new MemoryStream(data, 0, data.Length, false, true)) { return(await storageContainer.CreateRecordAsync(name, buffer, contentType, progress, cancellationToken).ConfigureAwait(false)); } }
public static IStorageRecord CreateRecord(this IStorageContainer storageContainer, string name, byte[] data, string contentType = null, IProgress progress = null) => storageContainer.CreateRecordAsync(name, data, contentType, progress).GetAwaiter().GetResult();