Skip to content

Source generation for databases, influenced by Dapper

License

Notifications You must be signed in to change notification settings

credfeto/credfeto-database-source-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2287d0c · Nov 29, 2024
Nov 27, 2024
Feb 20, 2024
Nov 29, 2024
Jul 18, 2024
Feb 11, 2023
Oct 14, 2024
Sep 17, 2024
Feb 11, 2023
Nov 29, 2024
May 17, 2023
Feb 11, 2023
May 16, 2023
May 17, 2023

Repository files navigation

credfeto-database-source-generator

Database source generator

Using

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>

Viewing Compiler Generated files

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>

Build Status

Branch Status
main Build: Pre-Release
release Build: Release

Changelog

View changelog

Contributors