VOOZH about

URL: https://www.nuget.org/packages/DKNet.EfCore.Abstractions/

⇱ NuGet Gallery | DKNet.EfCore.Abstractions 10.0.27




👁 Image
DKNet.EfCore.Abstractions 10.0.27

dotnet add package DKNet.EfCore.Abstractions --version 10.0.27
 
 
NuGet\Install-Package DKNet.EfCore.Abstractions -Version 10.0.27
 
 
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="DKNet.EfCore.Abstractions" Version="10.0.27" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DKNet.EfCore.Abstractions" Version="10.0.27" />
 
Directory.Packages.props
<PackageReference Include="DKNet.EfCore.Abstractions" />
 
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 DKNet.EfCore.Abstractions --version 10.0.27
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DKNet.EfCore.Abstractions, 10.0.27"
 
 
#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 DKNet.EfCore.Abstractions@10.0.27
 
 
#: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=DKNet.EfCore.Abstractions&version=10.0.27
 
Install as a Cake Addin
#tool nuget:?package=DKNet.EfCore.Abstractions&version=10.0.27
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

DKNet.EfCore.Abstractions

👁 NuGet
👁 NuGet Downloads
👁 .NET

Core abstractions and interfaces for Entity Framework Core applications implementing Domain-Driven Design (DDD) patterns. This package provides essential base classes, interfaces, and attributes for building robust data access layers with auditing, events, and entity management capabilities.

Features

  • Entity Base Classes: Generic entity base classes with flexible key types
  • Audit Interfaces: Built-in auditing capabilities with creation and modification tracking
  • Event Management: Domain event support for entities (IEventEntity)
  • Soft Delete Support: Soft deletion patterns for logical record removal
  • Concurrency Control: Optimistic concurrency control interfaces
  • Sequence Attributes: Database sequence generation for unique identifiers
  • Static Data Attributes: Marking entities for static/reference data
  • Ignore Entity Attributes: Control over entity discovery and mapping

Supported Frameworks

  • .NET 9.0+
  • Entity Framework Core 9.0+

Installation

Install via NuGet Package Manager:

dotnet add package DKNet.EfCore.Abstractions

Or via Package Manager Console:

Install-Package DKNet.EfCore.Abstractions

Quick Start

Basic Entity Implementation

using DKNet.EfCore.Abstractions.Entities;

public class Product : Entity<Guid>
{
 public Product(string name, decimal price, string createdBy) 
 : base(Guid.NewGuid(), createdBy)
 {
 Name = name;
 Price = price;
 }

 public string Name { get; private set; }
 public decimal Price { get; private set; }
 
 public void UpdatePrice(decimal newPrice, string updatedBy)
 {
 Price = newPrice;
 SetUpdatedBy(updatedBy);
 }
}

Auditable Entity

using DKNet.EfCore.Abstractions.Entities;

public class Customer : AuditEntity<int>
{
 public Customer(string name, string email, string createdBy) 
 : base(createdBy)
 {
 Name = name;
 Email = email;
 }

 public string Name { get; private set; }
 public string Email { get; private set; }
 
 // Inherits: CreatedBy, CreatedOn, UpdatedBy, UpdatedOn
}

Soft Deletable Entity

using DKNet.EfCore.Abstractions.Entities;

public class Document : Entity<Guid>, ISoftDeletableEntity
{
 public Document(string title, string createdBy) : base(Guid.NewGuid(), createdBy)
 {
 Title = title;
 }

 public string Title { get; private set; }
 public bool IsDeleted { get; private set; }
 public DateTimeOffset? DeletedOn { get; private set; }
 public string? DeletedBy { get; private set; }

 public void SoftDelete(string deletedBy)
 {
 IsDeleted = true;
 DeletedOn = DateTimeOffset.UtcNow;
 DeletedBy = deletedBy;
 }
}

Configuration

Entity Configuration with Attributes

using DKNet.EfCore.Abstractions.Attributes;

[StaticData] // Marks as reference/static data
public class Category : Entity<int>
{
 [Sequence(typeof(int))] // Auto-generate sequence values
 public int Order { get; set; }
 
 public string Name { get; set; }
}

[IgnoreEntity] // Exclude from EF discovery
public class TemporaryData
{
 public string Value { get; set; }
}

SQL Sequence Configuration

using DKNet.EfCore.Abstractions.Attributes;

public class Invoice : Entity<long>
{
 [SqlSequence("invoice_number_seq", Schema = "billing")]
 public long InvoiceNumber { get; set; }
 
 public decimal Amount { get; set; }
}

API Reference

Core Interfaces

  • IEntity<TKey> - Basic entity contract with generic key
  • IAuditedProperties - Auditing properties (CreatedBy, CreatedOn, etc.)
  • ISoftDeletableEntity - Soft deletion capabilities
  • IEventEntity - Domain event management
  • IConcurrencyEntity - Optimistic concurrency control

Base Classes

  • Entity<TKey> - Generic entity base with event support
  • AuditEntity<TKey> - Entity with full audit trail capabilities

Attributes

  • [Sequence(Type)] - Generate sequential values for fields
  • [SqlSequence(string)] - SQL-based sequence generation
  • [StaticData] - Mark entity as static/reference data
  • [IgnoreEntity] - Exclude entity from EF discovery

Advanced Usage

Domain Events with Entities

public class Order : Entity<Guid>
{
 public Order(string customerName, string createdBy) : base(Guid.NewGuid(), createdBy)
 {
 CustomerName = customerName;
 Status = OrderStatus.Pending;
 
 // Add domain event
 AddEvent(new OrderCreatedEvent(Id, customerName));
 }

 public string CustomerName { get; private set; }
 public OrderStatus Status { get; private set; }
 
 public void Complete(string updatedBy)
 {
 Status = OrderStatus.Completed;
 SetUpdatedBy(updatedBy);
 
 // Add domain event
 AddEvent(new OrderCompletedEvent(Id));
 }
}

public record OrderCreatedEvent(Guid OrderId, string CustomerName);
public record OrderCompletedEvent(Guid OrderId);

Custom Audit Implementation

public class CustomAuditEntity : Entity<Guid>, IAuditedProperties
{
 protected CustomAuditEntity(string createdBy) : base(Guid.NewGuid(), createdBy)
 {
 CreatedBy = createdBy;
 CreatedOn = DateTimeOffset.UtcNow;
 }

 public string CreatedBy { get; protected set; }
 public DateTimeOffset CreatedOn { get; protected set; }
 public string? UpdatedBy { get; protected set; }
 public DateTimeOffset? UpdatedOn { get; protected set; }

 protected void SetUpdatedBy(string updatedBy)
 {
 UpdatedBy = updatedBy;
 UpdatedOn = DateTimeOffset.UtcNow;
 }
}

Aggregate Root Pattern

public class AggregateRoot : Entity<Guid>
{
 protected AggregateRoot(string createdBy) : base(Guid.NewGuid(), createdBy)
 {
 }

 // Additional aggregate-specific behavior
 // Event management, invariant enforcement, etc.
}

Entity Lifecycle

The abstractions support full entity lifecycle management:

  1. Creation: Entities initialized with required audit information
  2. Modification: Automatic tracking of changes and updates
  3. Event Handling: Domain events queued and managed
  4. Soft Deletion: Logical removal without physical deletion
  5. Concurrency: Optimistic concurrency control support

Thread Safety

  • Entity instances are not thread-safe by design (following EF Core patterns)
  • Event collections are managed internally and should not be accessed concurrently
  • Use appropriate concurrency control mechanisms in your DbContext

Performance Considerations

  • Generic key types provide flexibility without boxing overhead
  • Event collections use efficient Collection<T> internally
  • Audit properties use DateTimeOffset for timezone-aware timestamps
  • Sequence attributes optimize database-generated values

Contributing

See the main for guidelines on how to contribute to this project.

License

This project is licensed under the .

Related Packages

  • - EF Core functionality extensions
  • - Domain event handling and dispatching
  • - Repository pattern implementations
  • - EF Core lifecycle hooks

Part of the DKNet Framework - A comprehensive .NET framework for building modern, scalable applications.

Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on DKNet.EfCore.Abstractions:

Package Downloads
DKNet.EfCore.Extensions

DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures.

DKNet.EfCore.Events

DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures.

DKNet.EfCore.Repos.Abstractions

Package Description

DKNet.EfCore.AuditLogs

DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.27 214 5/22/2026
10.0.26 163 5/19/2026
10.0.25 467 3/27/2026
10.0.24 173 3/27/2026
10.0.23 168 3/27/2026
10.0.22 160 3/26/2026
10.0.21 215 3/17/2026
10.0.20 180 2/2/2026
10.0.19 322 1/21/2026
10.0.18 167 1/21/2026
10.0.17 199 1/19/2026
10.0.16 173 1/18/2026
10.0.15 185 1/18/2026
10.0.14 182 1/18/2026
10.0.13 176 1/17/2026
10.0.12 172 1/17/2026
10.0.11 179 1/17/2026
10.0.10 172 1/17/2026
10.0.9 178 1/16/2026
10.0.8 176 1/16/2026
Loading failed