Add project files.
This commit is contained in:
		
							
								
								
									
										16
									
								
								Core.Blueprint.DAL.Storage/Contracts/IBlobStorageService.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								Core.Blueprint.DAL.Storage/Contracts/IBlobStorageService.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| using Azure; | ||||
| using Azure.Storage.Blobs.Models; | ||||
| using Core.Blueprint.Storage; | ||||
| using Core.Blueprint.Storage.Adapters; | ||||
|  | ||||
| namespace Core.Blueprint.DAL.Storage.Contracts | ||||
| { | ||||
|     public interface IBlobStorageService | ||||
|     { | ||||
|         Task<IEnumerable<BlobFileAdapter>> GetBlobsListAsync(string? prefix); | ||||
|         Task<Response<BlobContentInfo>> UploadBlobAsync(string blobName, Stream content); | ||||
|         Task<BlobFileAdapter> UploadBlobAsync(BlobAddDto newBlob); | ||||
|         BlobDownloadUriAdapter DownloadBlobAsync(string blobName); | ||||
|         Task<BlobFileAdapter?> DeleteBlobAsync(string fileName); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										22
									
								
								Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| <Project Sdk="Microsoft.NET.Sdk"> | ||||
|  | ||||
|   <PropertyGroup> | ||||
|     <TargetFramework>net8.0</TargetFramework> | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|     <Nullable>enable</Nullable> | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <Compile Remove="Provider\BlobStorageService - Copy.cs" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Azure.Identity" Version="1.13.1" /> | ||||
|     <PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" /> | ||||
|     <PackageReference Include="Core.Blueprint.Storage" Version="0.3.0-alpha0049" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Azure" Version="1.9.0" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
							
								
								
									
										41
									
								
								Core.Blueprint.DAL.Storage/Provider/BlobStorageService.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								Core.Blueprint.DAL.Storage/Provider/BlobStorageService.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | ||||
| using Azure; | ||||
| using Azure.Storage.Blobs.Models; | ||||
| using Core.Blueprint.DAL.Storage.Contracts; | ||||
| using Core.Blueprint.Storage; | ||||
| using Core.Blueprint.Storage.Adapters; | ||||
| using Core.Blueprint.Storage.Contracts; | ||||
|  | ||||
| namespace Core.Blueprint.DAL.Storage.Service | ||||
| { | ||||
|     public class BlobStorageService(IBlobStorageProvider blobStorageProvider) : IBlobStorageService | ||||
|     { | ||||
|  | ||||
|         public async Task<Response<BlobContentInfo>> UploadBlobAsync(string blobName, Stream content) | ||||
|         { | ||||
|             var result = await blobStorageProvider.UploadBlobAsync(blobName, content); | ||||
|             return result; | ||||
|         } | ||||
|  | ||||
|         public async Task<BlobFileAdapter> UploadBlobAsync(BlobAddDto newBlob) | ||||
|         { | ||||
|             var result = await blobStorageProvider.UploadBlobAsync(newBlob); | ||||
|             return result; | ||||
|         } | ||||
|  | ||||
|         public async Task<IEnumerable<BlobFileAdapter>> GetBlobsListAsync(string? prefix) | ||||
|         { | ||||
|             return await blobStorageProvider.ListBlobsAsync(prefix); | ||||
|         } | ||||
|  | ||||
|         public BlobDownloadUriAdapter DownloadBlobAsync(string blobName) | ||||
|         { | ||||
|             var result = blobStorageProvider.GenerateBlobDownloadUri(blobName); | ||||
|             return result; | ||||
|         } | ||||
|  | ||||
|         public async Task<BlobFileAdapter?> DeleteBlobAsync(string blobName) | ||||
|         { | ||||
|             return await blobStorageProvider.DeleteBlobsAsync(blobName); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Sergio Matias Urquin
					Sergio Matias Urquin