示例#1
0
        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);
            }
        }
示例#2
0
 public static TModel Add <TModel>(this IObjectStore <TModel> store, TModel model)
 {
     return(store.AddAsync(model).Result);
 }