public async Task AddAsync(IFile file) { var metadata = FileMetadata.FromFile(file); await _metadataRepository.AddAsync(metadata); using (var stream = _documentStore.OpenWrite(file.Folder, file.ResourceId)) { await file.CopyToAsync(stream); // await .AddAsync(file.Folder, metadata.ResourceId, file.CopyToAsync); } }
public static TModel Add <TModel>(this IObjectStore <TModel> store, TModel model) { return(store.AddAsync(model).Result); }