Omnia.Utility
1.0.1
dotnet add package Omnia.Utility --version 1.0.1
NuGet\Install-Package Omnia.Utility -Version 1.0.1
<PackageReference Include="Omnia.Utility" Version="1.0.1" />
<PackageVersion Include="Omnia.Utility" Version="1.0.1" />
<PackageReference Include="Omnia.Utility" />
paket add Omnia.Utility --version 1.0.1
#r "nuget: Omnia.Utility, 1.0.1"
#:package Omnia.Utility@1.0.1
#addin nuget:?package=Omnia.Utility&version=1.0.1
#tool nuget:?package=Omnia.Utility&version=1.0.1
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
- Fork del repository
- Crea un branch per la tua feature
- Commit delle modifiche
- Push del branch
- 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 | Versions 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. |
-
net8.0
- AutoMapper (>= 14.0.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.10)
- Newtonsoft.Json (>= 13.0.3)
- Omnia.InterfaceUtility (>= 1.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.12.1)
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.