Database source generator
Add a reference to the Credfeto.Enumeration.Source.Generation
package in each project you need the code generation
to run.
<ItemGroup>
<PackageReference
Include="Credfeto.Database.Source.Generation"
Version="1.1.1.1"
PrivateAssets="All"
ExcludeAssets="runtime" />
</ItemGroup>
Reference the following package in the project that contains the attributes and interfaces that are used by the generator.
<ItemGroup>
<PackageReference
Include="Credfeto.Database.Interfaces"
Version="1.1.1.1"
PrivateAssets="All"
ExcludeAssets="runtime" />
</ItemGroup>
Add the following to the csproj file:
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
<!-- Don't include the output from a previous source generator execution into future runs; the */** trick here ensures that there's
at least one subdirectory, which is our key that it's coming from a source generator as opposed to something that is coming from
some other tool. -->
<Compile Remove="$(CompilerGeneratedFilesOutputPath)/*/**/*.cs" />
</ItemGroup>
Branch | Status |
---|---|
main | |
release |
View changelog