CFPS.Moduli.Utenti 1.0.0-alpha.2.1

This is a prerelease version of CFPS.Moduli.Utenti.
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
                    
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="CFPS.Moduli.Utenti" Version="1.0.0-alpha.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CFPS.Moduli.Utenti" Version="1.0.0-alpha.2.1" />
                    
Directory.Packages.props
<PackageReference Include="CFPS.Moduli.Utenti" />
                    
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 CFPS.Moduli.Utenti --version 1.0.0-alpha.2.1
                    
#r "nuget: CFPS.Moduli.Utenti, 1.0.0-alpha.2.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 CFPS.Moduli.Utenti@1.0.0-alpha.2.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=CFPS.Moduli.Utenti&version=1.0.0-alpha.2.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CFPS.Moduli.Utenti&version=1.0.0-alpha.2.1&prerelease
                    
Install as a Cake Tool

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 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. 
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.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