Skip to content

About

A collection of C# source generators that automatically generate boilerplate code at compile time, reducing manual coding and improving code maintainability.

Topics

Resources

Code of conduct

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

BB84.SourceGenerators

A collection of C# source generators that automatically generate boilerplate code at compile time, reducing manual coding and improving code maintainability.

CI CD CodeQL Dependabot

License: MIT C# .NET Standard 2.0 Issues LastCommit PullRequests RepoSize NuGet

Features

This package provides sixteen powerful source generators:

Each generator has its own page covering why to use it, its benefits and usage examples. See the documentation index for an overview.

Installation

Install the package via NuGet:

dotnet add package BB84.SourceGenerators

Or via Package Manager Console:

Install-Package BB84.SourceGenerators

In the project where you want to use the generators, add a reference to the package and include the appropriate using directive for the attributes:

using BB84.SourceGenerators.Attributes;

If the attributes are not recognized, make sure that the EmitCompilerGeneratedFiles property is set to true in the project file:

<PropertyGroup>
  <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>

Requirements

  • .NET Standard 2.0 or higher
  • C# 7.3 or higher
  • Supports .NET Framework 4.7.2+, .NET Core 2.0+, .NET 5+, .NET 6+, .NET 7+, .NET 8+

How It Works

Source generators run during compilation and generate additional C# source files that are compiled alongside your code. This means:

  • Zero runtime overhead - All code is generated at compile time
  • IntelliSense support - Generated code appears in Visual Studio IntelliSense
  • Debuggable - You can step through generated code during debugging
  • No reflection - Generated code uses direct method calls

Contributing

Contributions are welcome! If you have an idea for a new feature, improvement, or bug fix, please follow these steps:

  1. Have a look at the Issues to see if your idea has already been discussed.
  2. If you want to work on an existing issue, please comment on the issue to let others know you're working on it.
  3. Fork the repository and create a new branch for your contribution.
  4. Make your changes and commit them with clear and descriptive messages.
  5. Push your changes to your forked repository and submit a pull request to the main repository.

Code of Conduct

We expect all contributors to adhere to the Code of Conduct.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Robert Peter Meyer (BoBoBaSs84)

Changelog

See releases for version history and changelog.

About

A collection of C# source generators that automatically generate boilerplate code at compile time, reducing manual coding and improving code maintainability.

Topics

Resources

Code of conduct

Stars

2 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages