Ejemplo n.º 1
0
 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));
     }
 }
Ejemplo n.º 2
0
 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();