NPv.Domain.Core
2.0.0
dotnet add package NPv.Domain.Core --version 2.0.0
NuGet\Install-Package NPv.Domain.Core -Version 2.0.0
<PackageReference Include="NPv.Domain.Core" Version="2.0.0" />
<PackageVersion Include="NPv.Domain.Core" Version="2.0.0" />
<PackageReference Include="NPv.Domain.Core" />
paket add NPv.Domain.Core --version 2.0.0
#r "nuget: NPv.Domain.Core, 2.0.0"
#:package NPv.Domain.Core@2.0.0
#addin nuget:?package=NPv.Domain.Core&version=2.0.0
#tool nuget:?package=NPv.Domain.Core&version=2.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
| 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 (2)
Showing the top 2 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. |
GitHub repositories
This package is not used by any popular GitHub repositories.