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

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 (dropped net9.0 support).

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 Entity class (with Guid identity)
  • πŸ”– IEntity interface 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 mapping
  • GuidV7ValueGenerator β€” 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

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 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.
  • 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.

Version Downloads Last Updated
3.0.0 215 8/17/2026
2.0.0 747 12/24/2025
1.1.0 358 6/15/2025
1.0.2 238 6/5/2025
1.0.1 357 5/18/2025
1.0.0 212 5/17/2025