Class DataConventions
- Namespace
- eQuantic.Core.Data.Repository
- Assembly
- eQuantic.Core.Data.dll
The write conventions every provider honours — register one as a singleton
(services.AddSingleton(new DataConventions { ... })) to tune them; the defaults apply otherwise.
- Clock — the time source behind
CreatedAt/UpdatedAt/DeletedAtstamps (inject a fixed TimeProvider in tests). - LifecycleStamps / SoftDelete — the lifecycle conventions are
on by default for entities implementing the
eQuantic.Core.Domaininterfaces; turn them off when the interfaces are adopted for other reasons. - CurrentUserId — the who behind the stamps: a per-request accessor
(receives the scope's IServiceProvider, like a global-filter factory). When set,
entities carrying
CreatedById/UpdatedById/DeletedByIdmembers — theeQuantic.Core.DataModelshapes — are stamped by property-name convention.
public sealed class DataConventions
- Inheritance
-
DataConventions
- Inherited Members
Properties
Clock
The time source for lifecycle stamps (System by default).
public TimeProvider Clock { get; set; }
Property Value
CurrentUserId
The current user's id for the who stamps, resolved per request from the scope's service
provider. Return null to leave the members untouched (e.g. background work with no user).
public Func<IServiceProvider, object?>? CurrentUserId { get; set; }
Property Value
EnableSensitiveDataLogging
Whether log events may carry parameter values (and, on document stores, command bodies).
Off by default: statements log with placeholders only — the same policy the traces follow. Turn it
on in development the way EF's EnableSensitiveDataLogging is turned on: deliberately, knowing
the values land wherever the logs land.
public bool EnableSensitiveDataLogging { get; set; }
Property Value
LifecycleStamps
Whether CreatedAt/UpdatedAt (and the …ById members) stamp automatically.
public bool LifecycleStamps { get; set; }
Property Value
SoftDelete
Whether deletes of IEntityTimeEnded entities become soft deletes with the automatic live-rows filter.
public bool SoftDelete { get; set; }