NPv.Domain.Core
3.0.0
dotnet add package NPv.Domain.Core --version 3.0.0
NuGet\Install-Package NPv.Domain.Core -Version 3.0.0
<PackageReference Include="NPv.Domain.Core" Version="3.0.0" />
<PackageVersion Include="NPv.Domain.Core" Version="3.0.0" />
<PackageReference Include="NPv.Domain.Core" />
paket add NPv.Domain.Core --version 3.0.0
#r "nuget: NPv.Domain.Core, 3.0.0"
#:package NPv.Domain.Core@3.0.0
#addin nuget:?package=NPv.Domain.Core&version=3.0.0
#tool nuget:?package=NPv.Domain.Core&version=3.0.0
NPv.Domain.Core
Lightweight and reusable building blocks for modeling domain entities in .NET
π Breaking changes
v2.0.0
- Target framework updated to
net10.0(droppednet9.0support).
This is a personal library that focuses on the latest .NET runtime to keep maintenance simple and enjoyable.
β¨ Overview
NPv.Domain.Core provides a minimal and consistent base for defining domain entities across services and layers.
It supports clean modeling practices without introducing infrastructure or persistence concerns.
Designed for use in domain-driven applications following clean architecture, this library ensures your domain models stay framework-agnostic and clear.
π Features
- β
Base
Entityclass (withGuididentity) - π
IEntityinterface for generic modeling - π· Optional
[LongText]attribute for marking large text fields - π Compatible with EF Core and repository abstractions (e.g.,
IGenericRepository) - π§Ό No dependencies on infrastructure or frameworks
- π
OperationException- a standardized base entity for logging failed operations or events to persistent storage.
π§ Usage
Define your entity class:
public class Customer : Entity
{
public string Name { get; set; } = default!;
}
Use the [LongText] attribute to mark a string property as nvarchar(max):
[LongText]
public string Description { get; set; } = null!;
π§© EF Core Integration
To apply domain-related conventions automatically in Entity Framework Core,
consider using NPv.DataAccess.Ef,
which includes:
DefaultString256MaxLengthMappingβ applies default string length mappingGuidV7ValueGeneratorβ for optimized sequential GUIDs
π¦ Installation
This package is published as part of the NPv.Foundation.Net architectural set.
To install via NuGet:
dotnet add package NPv.Domain.Core
π§© Related Packages
NPv.DataAccess.Abstractions β generic repository contracts
Author's Note
This library grew out of my long-standing personal interest in structuring and publishing open source packages. Over time, Iβve revisited and refined earlier internal utilities and ideas, giving them a more consistent shape and preparing them for wider reuse. Along the way, Iβve also taken the opportunity to explore how open source distribution and licensing work in the .NET ecosystem.
Itβs a small step toward something Iβve always wanted to try β sharing practical, minimal tools that reflect years of learning, experimentation, and refinement.
Hopefully, someone finds it useful.
Nikolai π
βοΈ License
MIT β you are free to use this in commercial and open-source software.
| 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
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on NPv.Domain.Core:
| Package | Downloads |
|---|---|
|
NPv.DataAccess.Ef
NPv's IGenericRepository realisation for EF including: IDbContextFactory, IDbContextProvider, PerRequestDbContextProvider, ConsoleDbContextProvider |
|
|
NPv.DataAccess.Abstractions
Minimal interface contract for generic repository and raw SQL execution in .NET applications. Designed for layered architecture, DDD, and flexible data access patterns. |
|
|
NPv.Auth.Domain
Domain entities for accounts, refresh tokens, email confirmation, and password recovery in NPv authentication modules. |
GitHub repositories
This package is not used by any popular GitHub repositories.