CSharpEssentials.Entity
3.0.3
See the version list below for details.
dotnet add package CSharpEssentials.Entity --version 3.0.3
NuGet\Install-Package CSharpEssentials.Entity -Version 3.0.3
<PackageReference Include="CSharpEssentials.Entity" Version="3.0.3" />
<PackageVersion Include="CSharpEssentials.Entity" Version="3.0.3" />
<PackageReference Include="CSharpEssentials.Entity" />
paket add CSharpEssentials.Entity --version 3.0.3
#r "nuget: CSharpEssentials.Entity, 3.0.3"
#:package CSharpEssentials.Entity@3.0.3
#addin nuget:?package=CSharpEssentials.Entity&version=3.0.3
#tool nuget:?package=CSharpEssentials.Entity&version=3.0.3
CSharpEssentials.Entity
DDD foundation for .NET entities with auditing, soft deletion, and domain events.
Features
- EntityBase<TId> — Typed IDs with creation and modification audit fields.
- SoftDeletableEntityBase — Soft delete with
MarkAsDeleted,Restore, andMarkAsHardDeleted. - Domain Events — Raise and clear events for outbox or dispatcher patterns.
- Event Timing — Control when events publish with
[DomainEventTiming].
Installation
dotnet add package CSharpEssentials.Entity
Usage
Basic Entity
using CSharpEssentials.Entity;
public class Product : EntityBase<Guid>
{
public string Name { get; set; } = string.Empty;
}
var product = new Product { Id = Guid.NewGuid(), Name = "Laptop" };
product.SetCreatedInfo(DateTimeOffset.UtcNow, "system");
product.SetUpdatedInfo(DateTimeOffset.UtcNow, "admin");
Soft Deletable Entity
public class User : SoftDeletableEntityBase<Guid>
{
public string Name { get; set; } = string.Empty;
}
var user = new User();
user.MarkAsDeleted(DateTimeOffset.UtcNow, "Admin");
user.Restore();
Domain Events
public record OrderCreated(Guid OrderId) : IDomainEvent;
public class Order : EntityBase<Guid>
{
public void Create()
{
Id = Guid.NewGuid();
Raise(new OrderCreated(Id));
}
}
// Later (e.g., in EF Core SaveChanges)
foreach (var evt in order.DomainEvents)
{
// dispatch...
}
order.ClearDomainEvents();
Event Timing
// Published after transaction commits (default)
public record OrderCreatedEvent(Guid OrderId) : IDomainEvent;
// Published before transaction commits
[DomainEventTiming(DomainEventTiming.BeforeSave)]
public record OrderValidationEvent(Guid OrderId) : IDomainEvent;
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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 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. net11.0 is compatible. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- CSharpEssentials.Results (>= 3.0.3)
- CSharpEssentials.Time (>= 3.0.3)
- Microsoft.Bcl.TimeProvider (>= 8.0.0)
- System.Text.Json (>= 9.0.0)
-
net10.0
- CSharpEssentials.Results (>= 3.0.3)
- CSharpEssentials.Time (>= 3.0.3)
-
net11.0
- CSharpEssentials.Results (>= 3.0.3)
- CSharpEssentials.Time (>= 3.0.3)
-
net9.0
- CSharpEssentials.Results (>= 3.0.3)
- CSharpEssentials.Time (>= 3.0.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on CSharpEssentials.Entity:
| Package | Downloads |
|---|---|
|
CSharpEssentials
A comprehensive C# library enhancing functional programming capabilities with type-safe monads (Maybe, Result), discriminated unions (Any), and robust error handling. Features include: domain-driven design support, enhanced Entity Framework integration, testable time management, JSON utilities, and LINQ extensions. Built for modern C# development with focus on maintainability, testability, and functional programming principles. |
|
|
CSharpEssentials.EntityFrameworkCore
Enhances Entity Framework Core with functional programming patterns and DDD-friendly features. Includes base entity classes, soft delete support, audit trails, query filters, optimistic concurrency, PostgreSQL integration, query performance monitoring, and domain event handling. Perfect for building maintainable and scalable data access layers in modern .NET applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.4 | 3 | 5/6/2026 |
| 3.0.3 | 36 | 5/5/2026 |
| 3.0.2 | 84 | 5/5/2026 |
| 3.0.1 | 95 | 5/3/2026 |
| 3.0.0 | 90 | 5/3/2026 |
| 2.1.0 | 291 | 11/26/2025 |
| 2.0.9 | 259 | 9/30/2025 |
| 2.0.8 | 237 | 9/29/2025 |
| 2.0.7 | 239 | 9/29/2025 |
| 2.0.6 | 228 | 9/29/2025 |
| 2.0.5 | 240 | 9/29/2025 |
| 2.0.4 | 232 | 9/28/2025 |
| 2.0.3 | 230 | 9/28/2025 |
| 2.0.2 | 242 | 9/28/2025 |
| 2.0.1 | 230 | 9/28/2025 |
| 2.0.0 | 251 | 9/28/2025 |