A collection of C# source generators that automatically generate boilerplate code at compile time, reducing manual coding and improving code maintainability.
This package provides sixteen powerful source generators:
ICommand property generation (sync, async, parameterized, cancellable) for MVVMClone() and DeepClone() method generation with collection and struct supportIDisposable / IAsyncDisposable pattern generation with ordered resource cleanupEquals, GetHashCode, and operator generationINotifyPropertyChanged/INotifyPropertyChanging implementationToString() override generationEach generator has its own page covering why to use it, its benefits and usage examples. See the documentation index for an overview.
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>
Source generators run during compilation and generate additional C# source files that are compiled alongside your code. This means:
Contributions are welcome! If you have an idea for a new feature, improvement, or bug fix, please follow these steps:
We expect all contributors to adhere to the Code of Conduct.
This project is licensed under the MIT License - see the LICENSE file for details.
Robert Peter Meyer (BoBoBaSs84)
See releases for version history and changelog.