Logit.Utils.Excel 1.2.0

dotnet add package Logit.Utils.Excel --version 1.2.0
                    
NuGet\Install-Package Logit.Utils.Excel -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.Utils.Excel" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Logit.Utils.Excel" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Logit.Utils.Excel" />
                    
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.Utils.Excel --version 1.2.0
                    
#r "nuget: Logit.Utils.Excel, 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.Utils.Excel@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.Utils.Excel&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Logit.Utils.Excel&version=1.2.0
                    
Install as a Cake Tool

📦 Logit.Utils.Excel

Utilidad reusable para lectura estructurada de archivos Excel basada en EPPlus 8.4.0, diseñada para ser utilizada en microservicios .NET, procesos de carga masiva, validación previa y pipelines de procesamiento de archivos.

Este paquete NO contiene lógica de negocio, solo se encarga de leer Excel de forma consistente y predecible.


🎯 Objetivo

Centralizar la lectura de archivos Excel en un paquete común reutilizable entre microservicios, evitando:

  • Duplicar lógica de lectura
  • Dependencias directas a EPPlus en cada servicio
  • Errores por cambios de formato en archivos Excel

✨ Características

  • ✔ Compatible con .NET 8
  • ✔ Basado en EPPlus 8.4.0
  • ✔ Licencia No Comercial
  • ✔ Lectura por definición de hoja (ExcelSheetDefinition)
  • ✔ Integración sencilla con Dependency Injection
  • ✔ Pensado para flujos: Blob Storage → Validación → Bulk Insert

📁 Estructura del paquete

Logit.Utils.Excel
│
├── Abstractions
│   └── IExcelReader.cs
│
├── Models
│   └── ExcelSheetDefinition.cs
│
├── Services
│   └── EpplusExcelReader.cs
│
├── Bootstrap
│   └── EpplusBootstrap.cs
│
├── Extensions
│   └── ExcelServiceCollectionExtensions.cs
│
├── LICENSE.txt
└── README.md

📄 ExcelSheetDefinition

Define cómo debe leerse un archivo Excel sin acoplarte al DTO ni a la base de datos.

public static class ServiceProvidersExcelDefinition
{
    public static ExcelSheetDefinition Actual => new()
    {
        SheetName = "Datos",
        HeaderRow = 1,
        Columns = new()
        {
            { "Tipo de identificación (obligatorio)", 1 },
            { "Número de identificación (obligatorio - sin dígito de verificación)", 2 },
            { "Razón social o nombre completo (obligatorio)", 3 },
            { "Funciones (obligatorio)", 4 },
            { "Ciudad (sede principal)", 5 },
            { "Dirección (sede principal)", 6 },
            { "Código postal", 7 },
            { "Teléfono", 8 },
            { "Moneda", 9 },
            { "Medio de pago", 10 },
            { "Plazo de pago", 11 },
            { "Usuario responsable (email)", 12 },
            { "Código banco central (Solo para IMC)", 13 },
            { "Código de integración", 14 },
            { "Incoterm", 15 }
        }
    };
}

📌 Importante:
Los nombres de las columnas deben ser idénticos a los del Excel, incluyendo tildes y textos entre paréntesis.


📦 Instalación

dotnet add package Logit.Utils.Excel

🔧 Configuración (Dependency Injection)

builder.Services.AddLogitExcel();

Esto:

  • Configura la licencia No Comercial de EPPlus
  • Registra IExcelReader<T>

📥 Uso básico

var rows = await _excelReader.ReadAsync<ServiceProvidersExcelDto>(
    excelBytes,
    ServiceProvidersExcelDefinition.Actual,
    cancellationToken
);

excelBytes normalmente proviene de:

  • Azure Blob Storage
  • Email
  • API Gateway

⚖ Licencia EPPlus

Este paquete usa EPPlus bajo licencia No Comercial.

ExcelPackage.License = LicenseContext.NonCommercial;

Si necesitas uso comercial, deberás adquirir una licencia EPPlus válida.


📄 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 126 1/21/2026
1.1.0 209 12/24/2025
1.0.0 298 12/18/2025