File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
ManagedCode.Storage.AspNetExtensions Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Threading . Tasks ;
3+ using ManagedCode . Communication ;
4+ using ManagedCode . Storage . Core ;
5+ using ManagedCode . Storage . Core . Models ;
6+ using Microsoft . AspNetCore . Components . Forms ;
7+ using Microsoft . AspNetCore . Mvc ;
8+
9+ namespace ManagedCode . Storage . AspNetExtensions ;
10+
11+ public class BaseController : Controller
12+ {
13+ private readonly IStorage _storage ;
14+
15+ public BaseController ( IStorage storage )
16+ {
17+ _storage = storage ;
18+ }
19+
20+ protected async Task < Result < BlobMetadata > > UploadToStorageAsync ( IBrowserFile formFile ,
21+ UploadOptions ? options = null )
22+ {
23+ return await _storage . UploadToStorageAsync ( formFile , options ) ;
24+ }
25+
26+ protected async Task < Result < BlobMetadata > > UploadToStorageAsync ( IBrowserFile formFile ,
27+ Action < UploadOptions > options )
28+ {
29+ return await _storage . UploadToStorageAsync ( formFile , options ) ;
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments