You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Src/RCommon.Entities/README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ Domain entity base classes for the RCommon framework, providing a strongly-typed
10
10
-`AuditedEntity` base classes that track `CreatedBy`, `DateCreated`, `LastModifiedBy`, and `DateLastModified` with flexible user types
11
11
-`ITrackedEntity` interface for opting entities into event tracking
12
12
-`IEntityEventTracker` and `InMemoryEntityEventTracker` for collecting entity events across object graphs and routing them through `IEventRouter`
13
+
-**Soft delete** -- `ISoftDelete` opt-in interface for logical deletion (`IsDeleted` flag) instead of physical removal
14
+
-**Multitenancy** -- `IMultiTenant` opt-in interface for tenant-scoped entities (`TenantId` property)
13
15
-`EntityNotFoundException` for consistent "entity not found" error handling with type and ID context
14
16
15
17
## Installation
@@ -63,6 +65,53 @@ public class OrderService
63
65
}
64
66
```
65
67
68
+
### Soft Delete
69
+
70
+
Implement `ISoftDelete` to opt an entity into logical deletion. Repositories will set `IsDeleted = true` and perform an UPDATE instead of a physical DELETE:
Entities implementing `ISoftDelete` are automatically filtered on read operations -- soft-deleted records are excluded from query results by default.
89
+
90
+
### Multitenancy
91
+
92
+
Implement `IMultiTenant` to scope an entity to a specific tenant. Repositories will automatically stamp the `TenantId` on add operations and filter reads to only return records for the current tenant:
0 commit comments