Omnia.Utility 1.0.1

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

Omnia.Utility

Libreria di utility comuni per il framework Omnia, che fornisce classi e helper per sviluppare applicazioni ASP.NET Core con funzionalità avanzate.

Funzionalità

🔐 Autenticazione e Autorizzazione

  • JWT Token Handling - Gestione completa dei token JWT
  • Authentication Extensions - Extension methods per ASP.NET Core
  • Authorization Utilities - Helper per politiche di autorizzazione

📁 Gestione File

  • FileStatic - Utility per file statici
  • FormFileUtility - Helper per upload e gestione FormFile
  • File Controllers - Controller base per operazioni sui file

🗃️ Repository e Service Pattern

  • Service Repository - Pattern base per servizi
  • Generic Service - Implementazioni generiche riutilizzabili
  • Standard Controller - Controller base con operazioni CRUD

📊 Paginazione e DTO

  • Pagination Utilities - Sistema di paginazione completo
  • QDTO (Query DTO) - Pattern per query complesse
  • AutoMapper Integration - Profili di mapping automatico

📝 Logging e Monitoring

  • Logger Utilities - Sistema di logging strutturato
  • Mapping Profiles - Profili AutoMapper preconfigurati

Installazione

dotnet add package Omnia.Utility

Utilizzo Base

Configurazione in Program.cs

using Omnia.Utility;

var builder = WebApplication.CreateBuilder(args);

// Aggiungi servizi Omnia
builder.Services.AddOmniaUtilities();

var app = builder.Build();

File Upload

public class MyController : ControllerBase
{
    [HttpPost("upload")]
    public async Task<IActionResult> Upload(IFormFile file)
    {
        var result = await FormFileUtility.ProcessFileAsync(file);
        return Ok(result);
    }
}

Paginazione

public async Task<PagedResult<Product>> GetProducts(PaginationRequest request)
{
    return await _repository.GetPagedAsync(request);
}

JWT Authentication

// Configura JWT
builder.Services.AddJwtAuthentication(builder.Configuration);

// Nel controller
[Authorize]
public class SecureController : ControllerBase
{
    // Endpoint sicuri
}

Dipendenze

  • AutoMapper - Mapping tra oggetti
  • Microsoft.AspNetCore.Authentication.JwtBearer - Autenticazione JWT
  • Newtonsoft.Json - Serializzazione JSON
  • System.IdentityModel.Tokens.Jwt - Gestione token JWT

Compatibilità

  • .NET 8.0 o superiore
  • ASP.NET Core 8.0 o superiore
  • Entity Framework Core (per repository pattern)

Esempio Completo

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Omnia.Utility;

[ApiController]
[Route("api/[controller]")]
public class ProductsController : StandardController<Product>
{
    private readonly IProductService _service;

    public ProductsController(IProductService service) : base(service)
    {
        _service = service;
    }

    [HttpGet("paged")]
    public async Task<IActionResult> GetPaged([FromQuery] PaginationRequest request)
    {
        var result = await _service.GetPagedAsync(request);
        return Ok(result);
    }

    [HttpPost("upload")]
    [Authorize]
    public async Task<IActionResult> UploadFile(IFormFile file)
    {
        var result = await FormFileUtility.ProcessFileAsync(file);
        return Ok(result);
    }
}

Contribuire

  1. Fork del repository
  2. Crea un branch per la tua feature
  3. Commit delle modifiche
  4. Push del branch
  5. Crea una Pull Request

Licenza

Questo progetto è distribuito sotto licenza LGPL-3.0-or-later.

Autore

Luca Gualandi - Sviluppatore del framework Omnia

Supporto

Per supporto e domande, contatta il team di sviluppo o apri una issue nel repository.

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 (1)

Showing the top 1 NuGet packages that depend on Omnia.Utility:

Package Downloads
Omnia.GenericImplementationEF

Implementazioni generiche per Entity Framework Core nel framework Omnia - Repository, AutoMapper, PredicateUtility e pattern avanzati

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 197 10/20/2025
1.0.0 267 9/22/2025