Skip to main content

Source generators overview

Several Roslyn incremental generators under src/KandraCore/Kandra.Generators.* remove boilerplate a newcomer might otherwise expect to hand-write. Check the generator's own output in each project's Generated.Net/ folder before writing anything by hand — if it's already there, you're looking at generated code and should edit the attribute/Dto driving it instead.

GeneratorEmitsInto
Kandra.Generators.ApiPer-entity CRUD controllersKandraWms.WebApi
Kandra.Generators.ClientLibAddWmsServices() client DI (Refit clients + wrappers)client project
Kandra.Generators.EfConfigIEntityTypeConfiguration<T>each project's Generated.Net/
Kandra.Generators.Di.Application / .Di.PersistencePer-entity AddDictionary<>/AddDocument<>/behavior/repository/register DI blocksConfigureServices.cs
Kandra.Generators.EqualityEquals/GetHashCode/ToString (+ BuildEqualityPredicate for register Dimensions)[KandraGeneratedEquality] partials
Kandra.Generators.ConstantsStrongly-typed constant accessors
Kandra.Generators.Ui (Document/Report emitters)Blazor UI pagesEditors/Printable attribute families

Discovery generally walks Compilation + referenced-assembly symbols (not ForAttributeWithMetadataName, which only sees the current project's syntax) because attributed types typically live in a referenced project (KandraWms.Forms/KandraWms.Domain) rather than the generator-consuming project itself.

Still hand-written, not generated: the Refit client interfaces themselves (Refit's compile-time generator can't see generator-emitted interfaces), reports/data-processors' DI wiring in some configurations, and anything not covered by an attribute family yet — check the platform's docs/kandra-gaps-tracking.md before assuming a gap is permanent.

See Generated API Reference for the concrete generator API surface once the XML doc sync has run.