CFPS.Moduli.Utenti
1.0.0-alpha.2.1
dotnet add package CFPS.Moduli.Utenti --version 1.0.0-alpha.2.1
NuGet\Install-Package CFPS.Moduli.Utenti -Version 1.0.0-alpha.2.1
<PackageReference Include="CFPS.Moduli.Utenti" Version="1.0.0-alpha.2.1" />
<PackageVersion Include="CFPS.Moduli.Utenti" Version="1.0.0-alpha.2.1" />
<PackageReference Include="CFPS.Moduli.Utenti" />
paket add CFPS.Moduli.Utenti --version 1.0.0-alpha.2.1
#r "nuget: CFPS.Moduli.Utenti, 1.0.0-alpha.2.1"
#:package CFPS.Moduli.Utenti@1.0.0-alpha.2.1
#addin nuget:?package=CFPS.Moduli.Utenti&version=1.0.0-alpha.2.1&prerelease
#tool nuget:?package=CFPS.Moduli.Utenti&version=1.0.0-alpha.2.1&prerelease
CFPS.Moduli.Utenti
Modulo utenti modulare basato su Clean Architecture + DDD + CQRS + MediatR.
Il modulo fornisce gestione completa utenti:
- Creazione utenti
- Aggiornamento utenti
- Eliminazione utenti
- Login con password hashing
- Query paginata utenti
- Gestione ruoli e livelli accesso
- Pipeline behaviors (Validation + UnitOfWork)
π§± Architettura
Il modulo Γ¨ composto da:
- Core β EntitΓ dominio e DTO
- Application β CQRS, Handlers, Mapping, Security
- Infrastructure β EF Core + Repository + SQLite
- Bootstrap β Entry point DI + configurazione modulo
π¦ Installazione
Installazione tramite NuGet:
dotnet add package CFPS.Moduli.Utenti
βοΈ Configurazione in WPF
Nel App.xaml.cs o bootstrap principale:
using CFPS.Moduli.Utenti.Bootstrap;
using Microsoft.Extensions.DependencyInjection;
public partial class App : Application
{
public static IServiceProvider ServiceProvider { get; private set; }
protected override void OnStartup(StartupEventArgs e)
{
var services = new ServiceCollection();
services.AddUserModule(new UserModuleOptions
{
ConnectionString = "Data Source=users.db"
});
ServiceProvider = services.BuildServiceProvider();
base.OnStartup(e);
}
}
π Migrazione Database
Al primo avvio:
ServiceProvider.EnsureUserModuleMigrated(); π§ Uso CQRS con MediatR β Creazione utente
var result = await mediator.Send(new CreateUserCommand(userDto));
if (result.IsSuccess)
{
// utente creato
}
else
{
// gestione errore
}
βοΈ Aggiornamento utente
var result = await mediator.Send(new UpdateUserCommand(userDto));
β Eliminazione utente
var result = await mediator.Send(new DeleteUserCommand(userId));
π Login utente
var result = await mediator.Send(new LoginUserCommand(username, password));
if (result.IsSuccess)
{
var user = result.Value;
}
π Query utenti paginata
var result = await mediator.Send(new GetUsersQuery(
page: 1,
pageSize: 20,
search: "mario"
));
if (result.IsSuccess)
{
var data = result.Value.Items;
var totalPages = result.Value.TotalPages;
}
π§© Result Pattern
Il modulo utilizza un Result pattern:
Result.Success(value)
Result.Fail(error)
π Password hashing
Il modulo utilizza BCrypt.Net-Next per la sicurezza delle password.
π§ͺ Pipeline Behaviors
Sono inclusi automaticamente:
β ValidationBehavior
Valida i comandi tramite FluentValidation
β UnitOfWorkBehavior
Gestisce commit automatico delle transazioni
ποΈ Dependency Injection
Il bootstrap registra automaticamente:
DbContext (SQLite) Repository MediatR Validators Security services Pipeline behaviors
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- CFPS.Moduli.Utenti.Application (>= 1.0.0)
- CFPS.Moduli.Utenti.Infrastructure (>= 1.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection (>= 10.0.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.6)
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.0.0-alpha.2.1 | 67 | 4/28/2026 |
| 1.0.0-alpha.2 | 70 | 4/28/2026 |
| 1.0.0-alpha.1 | 64 | 4/27/2026 |