Skip to content

About

Source Generator for entity builders

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Entity Builder Generator

Learnings

  • Use the versions of the source generator packages in the official docs
  • Debugging can be done by attaching to VBCSCompiler.dll
  • I haven't figured out how to use IncrementalSourceGenerator
  • Id or {EntityName}Id is the Primary Key convention
  • Writing tests against example generated code is better than testing the generator itself

Guides and Tutorials

Source Code Generator Official Docs

Source Code Generator Cookbook

EF Conventions

TODO

  • Id naming convention for construction
  • Configurable namespace
  • Self-to-one properties
  • Self-to-many properties
  • AddEntity passing builder for Entity
  • Protected and private setters for properties
  • Configure Id naming convention based on config
  • Add Build() method alternative for Builder.Entity getter
  • Should setting a parent of a child also add the child to the parents children collection?
  • Include/Exclude paths for entities. Is there a standard for syntax?
  • Create as a nuget package
  • Publish nuget package

Future

  • Refactoring to a SyntaxReceiver
  • Non-integer Ids
  • Key annotation
  • Respecting EntityTypeConfiguration
  • Independent Associations (Navigation property without Foreign Key)

Maybe

  • Generate builders in project A for entities contained in project B. Feasible?

About

Source Generator for entity builders

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages