NPv.Domain.Core 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package NPv.Domain.Core --version 1.0.1
                    
NuGet\Install-Package NPv.Domain.Core -Version 1.0.1
                    
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="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NPv.Domain.Core" Version="1.0.1" />
                    
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 1.0.1
                    
#r "nuget: NPv.Domain.Core, 1.0.1"
                    
#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@1.0.1
                    
#: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=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=NPv.Domain.Core&version=1.0.1
                    
Install as a Cake Tool

NPv.Domain.Core

Lightweight and reusable building blocks for modeling domain entities in .NET

โœจ 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

๐Ÿ”ง 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

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net9.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.

Version Downloads Last Updated
1.1.0 126 6/15/2025
1.0.2 141 6/5/2025
1.0.1 197 5/18/2025
1.0.0 112 5/17/2025