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
<PackageReference Include="BlackDigital.Domain" Version="26.10.20.2" />
<PackageVersion Include="BlackDigital.Domain" Version="26.10.20.2" />
<PackageReference Include="BlackDigital.Domain" />
paket add BlackDigital.Domain --version 26.10.20.2
#r "nuget: BlackDigital.Domain, 26.10.20.2"
#:package BlackDigital.Domain@26.10.20.2
#addin nuget:?package=BlackDigital.Domain&version=26.10.20.2
#tool nuget:?package=BlackDigital.Domain&version=26.10.20.2
BlackDigital.Domain
π§π· PortuguΓͺs | πΊπΈ English

Reusable domain building blocks for any .NET backend
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 nullableRolesandPolicyfor 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
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);
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);
}
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 | 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
- MailKitLite (>= 4.18.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- System.IdentityModel.Tokens.Jwt (>= 8.23.0)
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 |