BlackDigital.Domain 26.10.20.2

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

BlackDigital.Domain

πŸ‡§πŸ‡· PortuguΓͺs | πŸ‡ΊπŸ‡Έ English

BlackDigital.Domain Logo

Reusable domain building blocks for any .NET backend

License .NET

About the Project

BlackDigital.Domain is a shared library of infrastructure and security building blocks designed to be reused across any .NET backend project β€” REST APIs, background jobs, worker services, Azure Functions, and more. It has no dependency on ASP.NET Core, so it can be referenced from any project type.

Key Features

  • Email Infrastructure: SMTP email service (via MailKitLite) with multi-provider support and HTML template rendering
  • JWT Token Service: Generate, validate, and inspect JWT tokens
  • Password Hashing: Argon2id password hashing interface
  • Authorization Attribute: Dependency-free [Authorize] metadata with nullable Roles and Policy for classes, interfaces and methods

Installation

Via .NET CLI

dotnet add package BlackDigital.Domain

Via PackageReference

<PackageReference Include="BlackDigital.Domain" Version="26.10.11.01" />

Features

Email

Send transactional emails with SMTP and optional HTML templates.

using BlackDigital.Domain.Infrastructures;

var email = Email.Create()
    .To("user@example.com", "John Doe")
    .WithSubject("Welcome")
    .WithBody("<h1>Hello, John!</h1>", isHtml: true);

await emailService.SendEmailAsync(email);

Full Email Documentation

Security (JWT + Password Hashing)

using BlackDigital.Domain.Security;
using System.Security.Claims;

var tokenService = new JwtTokenService(secretKey, issuer, audience);

var claims = new[]
{
    new Claim(ClaimTypes.NameIdentifier, "123"),
    new Claim(ClaimTypes.Name, "john@example.com")
};

string token = tokenService.GenerateToken(Guid.NewGuid(), claims);

[Authorize]
public interface IUserService
{
    [Authorize(Roles = new[] { "Admin", "Manager" })]
    Task<IEnumerable<User>> ListUsersAsync();

    [Authorize(Policy = "Category.Write")]
    Task SaveUserAsync([Body] SaveUser user);
}

Full Security Documentation

Project Structure

BlackDigital.Domain/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Infrastructures/   # Email services (SMTP + templates)
β”‚   └── Security/          # JWT, password hashing and authorization attributes
β”œβ”€β”€ test/                  # Unit tests
β”œβ”€β”€ doc/                   # Documentation
└── README.md

License

This project is licensed under the MIT License - see the LICENSE file for details.

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 BlackDigital.Domain:

Package Downloads
BlackDigital.AspNet

BlackDigital ASP.NET Core Extensions

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.10.20.2 88 10/20/2026
26.10.20.1 74 10/20/2026
26.10.11.1 104 10/11/2026