VOOZH about

URL: https://www.nuget.org/packages/Omnia.InterfaceUtility/

⇱ NuGet Gallery | Omnia.InterfaceUtility 10.0.1




Omnia.InterfaceUtility 10.0.1

dotnet add package Omnia.InterfaceUtility --version 10.0.1
 
 
NuGet\Install-Package Omnia.InterfaceUtility -Version 10.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.InterfaceUtility" Version="10.0.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Omnia.InterfaceUtility" Version="10.0.1" />
 
Directory.Packages.props
<PackageReference Include="Omnia.InterfaceUtility" />
 
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.InterfaceUtility --version 10.0.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Omnia.InterfaceUtility, 10.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.InterfaceUtility@10.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.InterfaceUtility&version=10.0.1
 
Install as a Cake Addin
#tool nuget:?package=Omnia.InterfaceUtility&version=10.0.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Omnia.InterfaceUtility

Libreria di interfacce e utility per il framework Omnia, che fornisce contratti standardizzati per Controller, Service, Repository e componenti di paginazione.

Funzionalità

🎯 Interfacce Standard

  • IGenericController - Contratto base per controller CRUD
  • IGenericService - Interfaccia per servizi generici
  • IGenericRepository - Pattern repository standardizzato
  • File Controller Interfaces - Contratti per gestione file

📊 Paginazione

  • IPagination - Interfacce per paginazione avanzata
  • Query DTOs - Contratti per query complesse
  • Filtering e Sorting - Interfacce per filtri e ordinamento

🔧 Service Repository Pattern

  • Service Interfaces - Contratti per layer di servizio
  • Repository Interfaces - Contratti per layer di persistenza
  • Unit of Work - Pattern per transazioni

📁 File Management

  • IFileController - Interfaccia per controller file
  • File Operations - Contratti per operazioni sui file
  • Upload/Download - Interfacce standardizzate

Installazione

dotnet add package Omnia.InterfaceUtility

Utilizzo

Implementazione Repository

using Omnia.InterfaceUtility;

public class ProductRepository : IGenericRepository<Product>
{
 public async Task<Product> GetByIdAsync(int id)
 {
 // Implementazione
 }

 public async Task<IEnumerable<Product>> GetAllAsync()
 {
 // Implementazione
 }

 // Altri metodi CRUD...
}

Implementazione Service

public class ProductService : IGenericService<Product>
{
 private readonly IGenericRepository<Product> _repository;

 public ProductService(IGenericRepository<Product> repository)
 {
 _repository = repository;
 }

 // Implementa tutti i metodi dell'interfaccia
}

Controller con Interfacce

[ApiController]
[Route("api/[controller]")]
public class ProductsController : ControllerBase, IGenericController<Product>
{
 private readonly IGenericService<Product> _service;

 public ProductsController(IGenericService<Product> service)
 {
 _service = service;
 }

 // Implementa tutti i metodi CRUD standard
}

Paginazione

public async Task<IPaginatedResult<Product>> GetPagedProducts(IPaginationRequest request)
{
 return await _service.GetPagedAsync(request);
}

Interfacce Principali

IGenericRepository<T>

public interface IGenericRepository<T> where T : class
{
 Task<T> GetByIdAsync(int id);
 Task<IEnumerable<T>> GetAllAsync();
 Task<T> AddAsync(T entity);
 Task<T> UpdateAsync(T entity);
 Task<bool> DeleteAsync(int id);
 Task<IPaginatedResult<T>> GetPagedAsync(IPaginationRequest request);
}

IGenericService<T>

public interface IGenericService<T> where T : class
{
 Task<T> GetByIdAsync(int id);
 Task<IEnumerable<T>> GetAllAsync();
 Task<T> CreateAsync(T entity);
 Task<T> UpdateAsync(int id, T entity);
 Task<bool> DeleteAsync(int id);
 Task<IPaginatedResult<T>> GetPagedAsync(IPaginationRequest request);
}

IPaginationRequest

public interface IPaginationRequest
{
 int Page { get; set; }
 int PageSize { get; set; }
 string SortBy { get; set; }
 bool SortDescending { get; set; }
 string Filter { get; set; }
}

Dipendenze

  • Microsoft.AspNetCore.Mvc.Core - Per controller base
  • Microsoft.EntityFrameworkCore - Per pattern repository con EF

Compatibilità

  • .NET 8.0 o superiore
  • ASP.NET Core 8.0 o superiore
  • Entity Framework Core 8.0 o superiore

Vantaggi

Standardizzazione - Interfacce comuni in tutto il framework
Type Safety - Contratti fortemente tipizzati
Testabilità - Facile mocking per unit test
Riusabilità - Interfacce utilizzabili in tutti i progetti
Manutenibilità - Contratti stabili e ben definiti

Esempio di Dependency Injection

// In Program.cs
builder.Services.AddScoped<IGenericRepository<Product>, ProductRepository>();
builder.Services.AddScoped<IGenericService<Product>, ProductService>();

// In Controller
public class ProductsController : ControllerBase
{
 private readonly IGenericService<Product> _service;

 public ProductsController(IGenericService<Product> service)
 {
 _service = service;
 }
}

Contribuire

  1. Implementa le interfacce nei tuoi progetti
  2. Suggerisci nuove interfacce standard
  3. Migliora la documentazione
  4. Crea esempi di utilizzo

Licenza

LGPL-3.0-or-later

Autore

Luca Gualandi - Framework Omnia

Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (3)

Showing the top 3 NuGet packages that depend on Omnia.InterfaceUtility:

Package Downloads
Omnia.Utility

Libreria di utility comuni per il framework Omnia - include autenticazione JWT, gestione file, paginazione, exception handling middleware e pattern repository/service

Omnia.GenericImplementationEF

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

Omnia.GenericImplementationEF.Core

Core provider-agnostico per Omnia GenericImplementationEF - Repository, AutoMapper, IPredicateBuilder, AuthInterceptor e pattern avanzati

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.1 185 4/28/2026
10.0.0 151 4/28/2026
9.0.4 309 1/27/2026
9.0.2 216 1/22/2026
9.0.1 160 1/21/2026
9.0.0 238 1/9/2026
1.0.1 397 10/20/2025
1.0.0 472 9/18/2025