-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStorageService.cs
More file actions
29 lines (22 loc) · 1.01 KB
/
StorageService.cs
File metadata and controls
29 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using ECommerceAPI.Application.Abstractions.Storage;
using Microsoft.AspNetCore.Http;
namespace ECommerceAPI.Infrastructure.Services.Storage
{
public class StorageService : IStorageService
{
IStorage _storage;
public StorageService(IStorage storage)
{
_storage = storage;
}
public string StorageName { get => _storage.GetType().Name; }
public async Task DeleteAsync(string pathOrContainerName, string fileName)
=> await _storage.DeleteAsync(pathOrContainerName, fileName);
public List<string> GetFiles(string pathOrContainerName)
=> _storage.GetFiles(pathOrContainerName);
public bool HasFile(string pathOrContainerName, string fileName)
=> _storage.HasFile(pathOrContainerName, fileName);
public Task<List<(string fileName, string pathOrContainerName)>> UploadAsync(string pathOrContainerName, IFormFileCollection files)
=> _storage.UploadAsync(pathOrContainerName, files);
}
}