A C# source generator that automatically creates fluent builder APIs for your classes using attributes.
M31.FluentApi is a C# source generator that automatically creates fluent builder APIs for classes. It solves the problem of manually writing verbose and repetitive fluent interfaces by generating the code at development time based on simple attribute annotations. This allows for readable, step-by-step object construction without the overhead of large constructors.
C# developers and teams building libraries or applications that benefit from fluent APIs for configuration, testing, or domain object creation, especially those who value clean, maintainable code and reduced boilerplate.
Developers choose M31.FluentApi because it drastically reduces the manual effort of implementing fluent interfaces while providing extensive customization through attributes. Its incremental source generation ensures performance and immediate IDE integration, offering a seamless development experience.
Generate fluent builders for your C# classes with ease.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows precise control over method names, step order, and specialized handling for booleans and collections via attributes like FluentPredicate and FluentCollection, as shown in the Student example.
Generates code at development time using .NET's incremental source generators, ensuring fast builds and immediate IDE code completion, as highlighted in the README's philosophy.
Supports complex builder patterns with forking, branching, and optional methods through attributes like FluentContinueWith and FluentSkippable, enabling non-linear APIs.
Enables XML documentation for generated methods using a special //// syntax with fluent-prefixed tags, improving API usability, with code actions to generate boilerplate.
The README admits frequent issues with code completion lag and false errors, requiring workarounds like rebuilding or reloading projects, which can disrupt workflow.
Each member must be annotated with attributes, cluttering class definitions and increasing maintenance for large models, as seen in the Student class example with multiple attributes per property.
Only supports .NET 6 and 10, excluding projects on older frameworks or other .NET implementations, limiting adoption in legacy environments.