Albatross.EFCore.CodeGen 10.0.0-89.main

Prefix Reserved
This is a prerelease version of Albatross.EFCore.CodeGen.
This package has a SemVer 2.0.0 package version: 10.0.0-89.main+4e15071.
dotnet add package Albatross.EFCore.CodeGen --version 10.0.0-89.main
                    
NuGet\Install-Package Albatross.EFCore.CodeGen -Version 10.0.0-89.main
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Albatross.EFCore.CodeGen" Version="10.0.0-89.main">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Albatross.EFCore.CodeGen" Version="10.0.0-89.main" />
                    
Directory.Packages.props
<PackageReference Include="Albatross.EFCore.CodeGen">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Albatross.EFCore.CodeGen --version 10.0.0-89.main
                    
#r "nuget: Albatross.EFCore.CodeGen, 10.0.0-89.main"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Albatross.EFCore.CodeGen@10.0.0-89.main
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Albatross.EFCore.CodeGen&version=10.0.0-89.main&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Albatross.EFCore.CodeGen&version=10.0.0-89.main&prerelease
                    
Install as a Cake Tool

About

A companion code generator used by the Albatross.EFCore library.

Features

Instead of using reflection at runtime, this library will generate entity model builder at compile time using roslyn.

Quick Start

  • Create an entity
    public class Address {
      public int Id { get; set; }
      public string? City { get; set; }
    }
    
  • Crate the entity mapping class for the entity
    public class AddressEntityMap : EntityMap<Address> {
      public override void Map(EntityTypeBuilder<Address> builder) {
          builder.HasKey(x => x.Id);
      }
    }
    
  • The code generator will pick up on the AddressEntityMap class and generate the following code
    public static ModelBuilder BuildEntityModels(this ModelBuilder modelBuilder)
    {
      new Sample.Models.AddressEntityMap().Build(modelBuilder);
      return modelBuilder;
    }
    
  • To consume the generated code, use it directly in your custom DbContext class
    public class SampleDbSession : DbSession {
      protected override void OnModelCreating(ModelBuilder modelBuilder) {
        modelBuilder.HasDefaultSchema(My.Schema.Sample);
        modelBuilder.BuildEntityModels();
      }
    }
    
  • To turn on the debugging model and see the generated code in visual studio, add the following config change to the project file.
<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <EmitAlbatrossCodeGenDebugFile>true</EmitAlbatrossCodeGenDebugFile>
    </PropertyGroup>
    <ItemGroup>
        <CompilerVisibleProperty Include="EmitAlbatrossCodeGenDebugFile" />
    </ItemGroup>
</Project>
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0-89.main 39 4/24/2026
10.0.0-69.main 36 4/13/2026
10.0.0-54.main 34 3/30/2026
10.0.0-46.main 61 1/14/2026
10.0.0-32.main 61 12/11/2025
8.1.1 141 3/20/2025
8.1.0 105 3/16/2025
8.0.1 158 3/9/2025
7.5.11 241 3/5/2025