Skip to main content

Entities (*Base) overview

Every business object's *Base class is a pure EF Core model: no UI, authorization, or navigation attributes — those live exclusively on the paired *Dto (see DTOs & Validators). This split keeps *Base classes safe to reuse from jobs, importers, and migrations without dragging in UI concerns.

Common conventions across every *Base class:

  • Id is a Guid (sequential v7, via GuidV7ValueGenerator) — no int/long surrogate keys for business entities, ever.
  • Dictionaries and documents redeclare their contract properties (Code/Name for IDictionaryEntity, Code/DateTime for IDocumentEntity) as override on the concrete class, so each entity can attach generator-relevant attributes to them individually.
  • Marker attributes ([KandraDictionaryEntity], [KandraDocumentEntity], [KandraRegisterEntity], [KandraReportEntity], [KandraDataProcessorEntity]) are what Kandra.Generators.EfConfig and Kandra.Generators.Di.* discover to emit IEntityTypeConfiguration<T> and DI registration blocks — see Source Generators.

See Generated API Reference for the concrete base class hierarchy (DictionaryBase, DocumentBase, register base types) once the XML doc sync has run.