Logit.BlobStorage 1.2.0

dotnet add package Logit.BlobStorage --version 1.2.0
                    
NuGet\Install-Package Logit.BlobStorage -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Logit.BlobStorage" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Logit.BlobStorage" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Logit.BlobStorage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Logit.BlobStorage --version 1.2.0
                    
#r "nuget: Logit.BlobStorage, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Logit.BlobStorage@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Logit.BlobStorage&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Logit.BlobStorage&version=1.2.0
                    
Install as a Cake Tool

📦 Logit.BlobStorage

Paquete NuGet reutilizable para la gestión de archivos en Blob Storage, diseñado para microservicios, APIs y aplicaciones .NET modernas.

Este paquete abstrae:

  • Carga de archivos a Blob Storage
  • Descarga y eliminación de blobs
  • Configuración centralizada vía Dependency Injection
  • Manejo consistente de errores y validaciones

Sin acoplarse a controllers, DTOs de API ni frameworks web.


🚀 Características principales

  • ✅ Compatible con .NET 6 / 7 / 8
  • ✅ Pensado para microservicios y workers
  • ✅ Configuración mediante IOptions
  • ✅ Excepciones personalizadas
  • ✅ Extensible y fácil de testear
  • ✅ Sin dependencia directa de ASP.NET Core

📥 Instalación

dotnet add package Logit.BlobStorage

⚙️ Configuración

El paquete NO lee appsettings.json directamente.
La configuración es responsabilidad del proyecto host.

builder.Services.AddBlobStorage(options =>
{
    options.ConnectionString =
        builder.Configuration.GetConnectionString("BlobStorage");
    options.ContainerName = "documents";
});

🧩 Dependency Injection

El paquete expone un método de extensión para registro:

public static IServiceCollection AddBlobStorage(
    this IServiceCollection services,
    Action<BlobStorageOptions> configure)

Registra internamente:

  • Servicios de Blob Storage
  • Opciones de configuración
  • Manejo de excepciones

🗂️ Estructura interna del paquete

Logit.BlobStorage
│
├── Exceptions
│   └── BlobStorageException.cs
│
├── Extensions
│   └── BobStorageServiceCollectionExtensions.cs
│
├── Interface
│   └── IBlobStorageService.cs
│
├── Models
│   └── BlobFileResult.cs
│
├── Options
│   └── BlobStorageOptions.cs
│
├── Services
│   └── BlobStorageService.cs
│
├── DependencyInjection.cs
├── LICENSE.txt
└── README.md

💻 Uso de IBlobStorageService

public interface IBlobStorageService
{
    // Carga de archivos
    Task<FileUploadResult> UploadFileAsync(DocumentFile file, string? containerName = null);
    Task<IEnumerable<FileUploadResult>> UploadMultipleFilesAsync(IEnumerable<(Stream FileStream, string FileName)> files, string? containerName = null);

    // Descarga de archivos
    Task<byte[]?> DownloadFileAsync(string fileName, string? containerName = null);
    Task<Stream?> DownloadStreamingAsync(string fileName, string? containerName = null);
    Task<FileDownloadResult> DownloadDocumentAsync(string fileName, string? containerName = null);
    Task<IEnumerable<FileAttachment>> DownloadDocumentAsync(IEnumerable<DocumentFile> documents, string? containerName = null);

    // Gestión de blobs
    Task<bool> DeleteFileAsync(string fileName, string? containerName = null);
    Task<BlobFileInfo> GetFileInfoAsync(string fileName, string? containerName = null);
    Task<IEnumerable<BlobFileInfo>> ListFilesAsync(string containerName, string? prefix = null);    

}

🧠 Responsabilidad de cada capa

  • Interface: contratos públicos
  • Services: lógica de acceso a Blob Storage
  • Options: configuración vía IOptions
  • Models: modelos desacoplados de HTTP
  • Exceptions: errores controlados
  • Extensions / DependencyInjection: integración con el host

📄 Licencia

MIT License © Logit

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 309 12/16/2025
1.1.0 289 12/16/2025
1.0.0 308 12/15/2025

Initial release of Logit.BlobStorage library.