AccountSubSystem.Handlers 1.0.0

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

AccountSubSystem.Handlers

CQRS command and query handlers for the BDJobs Account SubSystem.

This package is the top-level orchestration layer of the Account SubSystem. It contains all the Handler classes that process commands (write operations) and queries (read operations), wiring together the Repositories, Aggregate Roots, and the Service Bus — following the CQRS pattern used across all BDJobs subsystems.


📦 Installation

.NET CLI

dotnet add package AccountSubSystem.Handlers --version 1.0.0

Package Manager Console

NuGet\Install-Package AccountSubSystem.Handlers -Version 1.0.0

PackageReference (add to your .csproj)

<PackageReference Include="AccountSubSystem.Handlers" Version="1.0.0" />

📋 Requirements

Requirement Value
Target Framework .NET 10.0
Package Version 1.0.0

📁 What's Inside

This package contains:

  • Query Handlers — process read requests (e.g. GetUserQueryHandler, GetBillTrackingQueryHandler)
  • Command Handlers — process write requests (e.g. CreateUserCommandHandler)
  • DI registrationAddAccountHandlers() extension to register all handlers in one call
  • Validation — FluentValidation validators wired per handler via the Service Bus pipeline

🚀 Usage

Step 1 — Register handlers in Program.cs

builder.Services.AddAccountHandlers(builder.Configuration);

Step 2 — Dispatch a query from your Controller

using AccountSubSystem.DTOs;

[ApiController]
[Route("api/[controller]")]
public class AccountController : ControllerBase
{
    private readonly IServiceBus _serviceBus;

    public AccountController(IServiceBus serviceBus)
    {
        _serviceBus = serviceBus;
    }

    [HttpGet("{userId}")]
    public async Task<IActionResult> GetUser(int userId)
    {
        var query = new GetUserQuery { UserId = userId };
        var result = await _serviceBus.SendAsync(query);
        return Ok(result);
    }
}

Step 3 — How a Handler looks internally

public class GetUserQueryHandler : IQueryHandler<GetUserQuery, UserResponseDto>
{
    private readonly IUserRepository _repository;

    public GetUserQueryHandler(IUserRepository repository)
    {
        _repository = repository;
    }

    public async Task<UserResponseDto> Handle(GetUserQuery query)
    {
        // 1. Fetch raw data from DB
        var entities = await _repository.GetByIdAsync(query.UserId);

        // 2. Build Aggregate Root
        var aggregateRoot = UserAggregateRoot.FromEntities(entities);

        // 3. Apply business rules
        aggregateRoot.ApplyBusinessRules();

        // 4. Return DTO
        return aggregateRoot.ToResponseDto();
    }
}

🔗 Dependencies

This package is the top of the AccountSubSystem tree and pulls in all other AccountSubSystem packages automatically:

Package Version
AccountSubSystem.Aggregators 1.0.0
AccountSubSystem.DTOs 1.0.0
AccountSubSystem.Repositories 1.0.0
ServiceBus.Handler 1.0.0
SharedSubSystem.DTOs 1.0.0
SharedSubSystem.Handler 1.0.0
SharedSubSystem.Services 1.0.0

All dependencies are installed automatically. You only need to install AccountSubSystem.Handlers and everything else comes with it.


🏗️ Architecture

AccountSubSystem.Handlers is at the top of the AccountSubSystem dependency tree. Installing this single package gives you the entire AccountSubSystem stack.

AccountSubSystem.Handlers  ← YOU ARE HERE (installs everything below)
    ├── AccountSubSystem.Aggregators
    │       └── AccountSubSystem.DTOs
    ├── AccountSubSystem.Repositories
    │       └── AccountSubSystem.Aggregators
    ├── ServiceBus.Handler
    │       └── SharedSubSystem.Handler
    ├── SharedSubSystem.DTOs
    ├── SharedSubSystem.Handler
    └── SharedSubSystem.Services

Full data flow:

HTTP Request
    → API Controller
        → IServiceBus.SendAsync(query)
            → Handler.Handle(query)           ← HERE
                → Repository.GetAsync()
                → AggregateRoot.FromEntities()
                → ApplyBusinessRules()
                → ToResponseDto()
    → HTTP Response

⚠️ Notes

  • If you only need DTOs (e.g. in a client project), install AccountSubSystem.DTOs instead — it is much lighter.
  • If you need the domain logic without database access, install AccountSubSystem.Aggregators.
  • Install AccountSubSystem.Handlers only in your API or subsystem project that actually processes requests.

👤 Author

BDJobs — Internal NuGet package for the BDJobs Conveyance Billing System.

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

Showing the top 1 NuGet packages that depend on AccountSubSystem.Handlers:

Package Downloads
AccountSubSystem.Auth

Login and cookie authentication for AccountSubSystem. Install this to add auth to any subsystem.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 136 6/18/2026