Add project files.

This commit is contained in:
Sergio Matias Urquin
2025-04-29 18:39:57 -06:00
parent 116793710f
commit 6358f5f199
110 changed files with 4484 additions and 0 deletions

View 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);
}
}

View 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>

View 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);
}
}
}