RCommon.Entities
2.3.2-alpha.0.2
See the version list below for details.
dotnet add package RCommon.Entities --version 2.3.2-alpha.0.2
NuGet\Install-Package RCommon.Entities -Version 2.3.2-alpha.0.2
<PackageReference Include="RCommon.Entities" Version="2.3.2-alpha.0.2" />
<PackageVersion Include="RCommon.Entities" Version="2.3.2-alpha.0.2" />
<PackageReference Include="RCommon.Entities" />
paket add RCommon.Entities --version 2.3.2-alpha.0.2
#r "nuget: RCommon.Entities, 2.3.2-alpha.0.2"
#:package RCommon.Entities@2.3.2-alpha.0.2
#addin nuget:?package=RCommon.Entities&version=2.3.2-alpha.0.2&prerelease
#tool nuget:?package=RCommon.Entities&version=2.3.2-alpha.0.2&prerelease
RCommon.Entities
Domain entity base classes for the RCommon framework, providing a strongly-typed BusinessEntity<TKey> base with built-in transactional event tracking, auditing support via AuditedEntity, and an IEntityEventTracker that collects and emits entity events through the event routing infrastructure.
Features
BusinessEntityandBusinessEntity<TKey>abstract base classes with composite and single-key support- Built-in transactional (local) event accumulation on entities via
AddLocalEvent,RemoveLocalEvent, andClearLocalEvents - Entity-level event notifications (
TransactionalEventAdded,TransactionalEventRemoved,TransactionalEventsCleared) for observing event changes AuditedEntitybase classes that trackCreatedBy,DateCreated,LastModifiedBy, andDateLastModifiedwith flexible user typesITrackedEntityinterface for opting entities into event trackingIEntityEventTrackerandInMemoryEntityEventTrackerfor collecting entity events across object graphs and routing them throughIEventRouterEntityNotFoundExceptionfor consistent "entity not found" error handling with type and ID context
Installation
dotnet add package RCommon.Entities
Usage
using RCommon.Entities;
using RCommon.Models.Events;
// Define a domain entity with a GUID key
public class Order : BusinessEntity<Guid>
{
public string ProductName { get; set; }
public int Quantity { get; set; }
public void Submit()
{
// Add a transactional event that will be emitted on persistence
AddLocalEvent(new OrderSubmittedEvent { OrderId = Id });
}
}
// Define an audited entity tracking who created/modified it
public class Invoice : AuditedEntity<Guid, string, string>
{
public decimal Amount { get; set; }
public string Currency { get; set; }
}
// Emit entity events through the event router
public class OrderService
{
private readonly IEntityEventTracker _eventTracker;
public OrderService(IEntityEventTracker eventTracker)
{
_eventTracker = eventTracker;
}
public async Task ProcessOrderAsync(Order order)
{
order.Submit();
_eventTracker.AddEntity(order);
await _eventTracker.EmitTransactionalEventsAsync();
}
}
Key Types
| Type | Description |
|---|---|
IBusinessEntity |
Base entity interface with composite key support and local event collection |
IBusinessEntity<TKey> |
Entity interface with a single strongly-typed Id property |
BusinessEntity |
Abstract base class with transactional event tracking and entity equality |
BusinessEntity<TKey> |
Generic base class adding a typed primary key to BusinessEntity |
IAuditedEntity<TCreatedByUser, TLastModifiedByUser> |
Audit contract with created/modified user and timestamp properties |
AuditedEntity<TKey, TCreatedByUser, TLastModifiedByUser> |
Base class combining BusinessEntity<TKey> with full audit tracking |
ITrackedEntity |
Marks an entity as eligible for event tracking via AllowEventTracking |
IEntityEventTracker |
Collects tracked entities and emits their transactional events |
InMemoryEntityEventTracker |
In-memory implementation that traverses entity object graphs and routes events |
EntityNotFoundException |
Exception for when an expected entity does not exist, with type and ID context |
Documentation
For full documentation, visit rcommon.com.
Related Packages
- RCommon.Core - Foundation package with event bus, builder pattern, guards, and extensions
- RCommon.Models - Shared models for CQRS commands, queries, events, pagination, and execution results
License
Licensed under the Apache License, Version 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
-
net10.0
- RCommon.Core (>= 2.3.2-alpha.0.2)
-
net8.0
- RCommon.Core (>= 2.3.2-alpha.0.2)
-
net9.0
- RCommon.Core (>= 2.3.2-alpha.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RCommon.Entities:
| Package | Downloads |
|---|---|
|
RCommon.Persistence
A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.4.1 | 78 | 2/18/2026 |
| 2.3.2-alpha.0.3 | 27 | 2/18/2026 |
| 2.3.2-alpha.0.2 | 30 | 2/18/2026 |
| 2.3.2-alpha.0.1 | 56 | 2/9/2026 |
| 2.3.1 | 227 | 2/5/2026 |
| 2.3.0 | 216 | 2/3/2026 |
| 2.2.2-alpha.0.1 | 394 | 12/11/2025 |
| 2.2.1-alpha.0.2 | 131 | 10/24/2025 |
| 2.2.1-alpha.0.1 | 147 | 10/24/2025 |
| 2.1.11-alpha.0.2 | 121 | 10/24/2025 |
| 2.1.11-alpha.0.1 | 99 | 7/18/2025 |
| 2.1.10 | 392 | 7/17/2025 |
| 2.1.9-alpha.0.1 | 150 | 7/17/2025 |
| 2.1.2.4 | 335 | 5/21/2025 |
| 2.1.2.3 | 310 | 5/1/2025 |
| 2.1.2.2 | 614 | 1/23/2025 |
| 2.1.2.1 | 276 | 1/17/2025 |
| 2.1.2 | 268 | 1/17/2025 |
| 2.1.1.4 | 273 | 1/7/2025 |
| 0.0.0-alpha.0 | 150 | 7/17/2025 |