Ejemplo n.º 1
0
        public async Task <FileComponent> UploadFileAsync(string parentId, string name, Stream stream)
        {
            var src = await _provider.UploadDocumentAsync(stream);

            var file = new File
            {
                Src            = src,
                Name           = name,
                Size           = stream.Length,
                ParentFolderId = parentId
            };

            await _repository.CreateAsync(file);

            return(ToComponent(file));
        }