Skip to content

Es/ref data code gen#145

Open
chullybun wants to merge 6 commits into
release/4from
es/ref-data-code-gen
Open

Es/ref data code gen#145
chullybun wants to merge 6 commits into
release/4from
es/ref-data-code-gen

Conversation

@chullybun
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 25, 2026 02:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new CoreEx.CodeGen reference-data code-generation capability (OnRamp/Handlebars-driven), wires it into the Contoso samples, and performs a broad documentation + packaging metadata uplift to support the new tooling and v4 preview packaging.

Changes:

  • Added CoreEx.CodeGen project with reference-data generators, templates, scripts, and generated configuration docs/schema support.
  • Updated Contoso Products/Shopping samples to consume generated reference-data artifacts (contracts/repositories/mappers/controllers) and added CI verification for “no changes” codegen runs.
  • Centralized package versioning via Version.props, refreshed NuGet package metadata/tags, and uplifted/additional README documentation across packages.

Reviewed changes

Copilot reviewed 216 out of 220 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
Version.props Central repo version definition.
tools/CoreEx.Tooling.Console/Program.cs Tool entry point for schema/docs generation.
tools/CoreEx.Tooling.Console/generate.ps1 Convenience script to run tooling.
tools/CoreEx.Tooling.Console/CoreEx.Tooling.Console.csproj New tooling console project.
tests/CoreEx.Database.SqlServer.Test.Unit/EntityFrameworkUowTests.cs Updated tests to TransactionAsync.
tests/CoreEx.Database.Postgres.Test.Unit/EntityFrameworkUowTests.cs Updated tests to TransactionAsync.
src/Directory.Build.props Imports root Version.props.
src/CoreEx/Wildcards/README.md New package README.
src/CoreEx/Validation/README.md New package README.
src/CoreEx/Text/README.md New package README.
src/CoreEx/Security/README.md New package README.
src/CoreEx/Schemas/README.md New package README.
src/CoreEx/Results/README.md New package README.
src/CoreEx/RefData/README.md New package README.
src/CoreEx/Metadata/README.md New package README.
src/CoreEx/Mapping/README.md New package README.
src/CoreEx/Localization/README.md New package README.
src/CoreEx/Invokers/README.md New package README.
src/CoreEx/Http/README.md New package README.
src/CoreEx/HealthChecks/README.md New package README.
src/CoreEx/Globalization/README.md New package README.
src/CoreEx/DependencyInjection/README.md New package README.
src/CoreEx/CoreEx.csproj Updated NuGet package tags.
src/CoreEx/Caching/README.md New package README.
src/CoreEx.Validation/CoreEx.Validation.csproj Added package metadata/tags.
src/CoreEx.Validation/Clauses/README.md New namespace README.
src/CoreEx.UnitTesting/Events/README.md New namespace README.
src/CoreEx.UnitTesting/Data/README.md New namespace README.
src/CoreEx.UnitTesting/CoreEx.UnitTesting.csproj Added package metadata/tags.
src/CoreEx.RefData/ReferenceDataT2.cs Added ThrowIfInactive/Invalid helpers.
src/CoreEx.RefData/HealthChecks/README.md New namespace README.
src/CoreEx.RefData/CoreEx.RefData.csproj Added package metadata/tags.
src/CoreEx.RefData/Abstractions/README.md New namespace README.
src/CoreEx.Events/Subscribing/Exceptions/README.md New namespace README.
src/CoreEx.Events/README.md New package README.
src/CoreEx.Events/Publishing/README.md New namespace README.
src/CoreEx.Events/CoreEx.Events.csproj Added package metadata/tags.
src/CoreEx.EntityFrameworkCore/CoreEx.EntityFrameworkCore.csproj Added package metadata/tags.
src/CoreEx.EntityFrameworkCore/Converters/README.md New namespace README.
src/CoreEx.DomainDriven/README.md New package README.
src/CoreEx.DomainDriven/CoreEx.DomainDriven.csproj Added package metadata/tags.
src/CoreEx.Database/Templates/EfModelBuilder_cs.hbs Improved generated header text.
src/CoreEx.Database/Templates/EfModel_cs.hbs Improved generated header text.
src/CoreEx.Database/Outbox/README.md New namespace README.
src/CoreEx.Database/Mapping/README.md New namespace README.
src/CoreEx.Database/Extended/README.md New namespace README.
src/CoreEx.Database/CoreEx.Database.csproj Added package metadata/tags.
src/CoreEx.Database/Abstractions/README.md New namespace README.
src/CoreEx.Database.SqlServer/CoreEx.Database.SqlServer.csproj Added package metadata/tags.
src/CoreEx.Database.Postgres/CoreEx.Database.Postgres.csproj Added package metadata/tags.
src/CoreEx.Data/IUnitOfWork.WithoutCancellation.cs Renamed convenience overloads to TransactionAsync.
src/CoreEx.Data/CoreEx.Data.csproj Added package metadata/tags.
src/CoreEx.CodeGen/Scripts/ref-data-script.yaml New ref-data generation script.
src/CoreEx.CodeGen/RefData/Templates/Service_cs.hbs New service template.
src/CoreEx.CodeGen/RefData/Templates/Repository_cs.hbs New repository template.
src/CoreEx.CodeGen/RefData/Templates/Mapper_cs.hbs New mapper template.
src/CoreEx.CodeGen/RefData/Templates/IRepository_cs.hbs New repo interface template.
src/CoreEx.CodeGen/RefData/Templates/Controller_cs.hbs New API controller template.
src/CoreEx.CodeGen/RefData/Templates/Contract_cs.hbs New contract template.
src/CoreEx.CodeGen/RefData/README.md New codegen docs.
src/CoreEx.CodeGen/RefData/Generators/RootGenerator.cs New generator.
src/CoreEx.CodeGen/RefData/Generators/MapperGenerator.cs New generator.
src/CoreEx.CodeGen/RefData/Generators/ContractGenerator.cs New generator.
src/CoreEx.CodeGen/RefData/Config/PropertyConfig.cs New config model + prep logic.
src/CoreEx.CodeGen/GlobalUsing.cs New global usings.
src/CoreEx.CodeGen/docs/Property.md Generated config documentation.
src/CoreEx.CodeGen/docs/Entity.md Generated config documentation.
src/CoreEx.CodeGen/docs/CodeGeneration.md Generated config documentation.
src/CoreEx.CodeGen/Counting/README.md New counting docs.
src/CoreEx.CodeGen/Counting/CodeGenCounter.cs New codegen counting logic.
src/CoreEx.CodeGen/CoreEx.CodeGen.csproj New CodeGen package project.
src/CoreEx.CodeGen/CommandType.cs New command enum.
src/CoreEx.CodeGen/CodeGenConsole.cs New CodeGen console host.
src/CoreEx.Caching.FusionCache/README.md New package README.
src/CoreEx.Caching.FusionCache/CoreEx.Caching.FusionCache.csproj Added package metadata/tags.
src/CoreEx.Azure.Messaging.ServiceBus/CoreEx.Azure.Messaging.ServiceBus.csproj Added package metadata/tags.
src/CoreEx.Azure.Messaging.ServiceBus/Abstractions/README.md New namespace README.
src/CoreEx.AspNetCore/Mvc/README.md New namespace README.
src/CoreEx.AspNetCore/Idempotency/README.md New namespace README.
src/CoreEx.AspNetCore/Http/README.md New namespace README.
src/CoreEx.AspNetCore/HealthChecks/README.md New namespace README.
src/CoreEx.AspNetCore/CoreEx.AspNetCore.csproj Added package metadata/tags.
src/CoreEx.AspNetCore/Abstractions/README.md New namespace README.
src/CoreEx.AspNetCore.NSwag/README.md New package README.
src/CoreEx.AspNetCore.NSwag/CoreEx.AspNetCore.NSwag.csproj Added package metadata/tags.
samples/src/Contoso.Shopping.Infrastructure/Repositories/ShoppingDbContext.g.cs Updated generated header text.
samples/src/Contoso.Shopping.Infrastructure/Repositories/ReferenceDataRepository.g.cs New generated repo implementation.
samples/src/Contoso.Shopping.Infrastructure/Repositories/ReferenceDataRepository.cs Converted to partial shell (ctor).
samples/src/Contoso.Shopping.Infrastructure/Persistence/UnitOfMeasure.g.cs Updated generated header text.
samples/src/Contoso.Shopping.Infrastructure/Persistence/Product.g.cs Updated generated header text.
samples/src/Contoso.Shopping.Infrastructure/Persistence/DiscountCoupon.g.cs Updated generated header text.
samples/src/Contoso.Shopping.Infrastructure/Persistence/BasketStatus.g.cs Updated generated header text.
samples/src/Contoso.Shopping.Infrastructure/Persistence/BasketItem.g.cs Updated generated header text.
samples/src/Contoso.Shopping.Infrastructure/Persistence/Basket.g.cs Updated generated header text.
samples/src/Contoso.Shopping.Infrastructure/Mapping/UnitOfMeasureMapper.g.cs New generated mapper.
samples/src/Contoso.Shopping.Infrastructure/Mapping/UnitOfMeasureMapper.cs Removed hand-written mapper.
samples/src/Contoso.Shopping.Infrastructure/Mapping/DiscountCouponMapper.g.cs New generated mapper.
samples/src/Contoso.Shopping.Infrastructure/Mapping/DiscountCouponMaper.cs Removed hand-written mapper.
samples/src/Contoso.Shopping.Infrastructure/Mapping/BasketStatusMapper.g.cs New generated mapper.
samples/src/Contoso.Shopping.Infrastructure/Mapping/BasketStatusMapper.cs Removed hand-written mapper.
samples/src/Contoso.Shopping.Database/Schema/Stored Procedures/spOutboxLeaseRelease.g.sql Updated generated header text.
samples/src/Contoso.Shopping.Database/Schema/Stored Procedures/spOutboxLeaseAcquire.g.sql Updated generated header text.
samples/src/Contoso.Shopping.Database/Schema/Stored Procedures/spOutboxEnqueue.g.sql Updated generated header text.
samples/src/Contoso.Shopping.Database/Schema/Stored Procedures/spOutboxBatchComplete.g.sql Updated generated header + logic.
samples/src/Contoso.Shopping.Database/Schema/Stored Procedures/spOutboxBatchClaim.g.sql Updated generated header text.
samples/src/Contoso.Shopping.Database/Schema/Stored Procedures/spOutboxBatchCancel.g.sql Updated generated header + logic.
samples/src/Contoso.Shopping.Contracts/UnitOfMeasure.g.cs New generated contract type.
samples/src/Contoso.Shopping.Contracts/UnitOfMeasure.cs Removed hand-written contract.
samples/src/Contoso.Shopping.Contracts/DiscountCoupon.g.cs New generated contract type.
samples/src/Contoso.Shopping.Contracts/DiscountCoupon.cs Retained custom partial members.
samples/src/Contoso.Shopping.Contracts/BasketStatus.g.cs New generated contract type.
samples/src/Contoso.Shopping.Contracts/BasketStatus.cs Retained custom partial members.
samples/src/Contoso.Shopping.CodeGen/ref-data.yaml New codegen config.
samples/src/Contoso.Shopping.CodeGen/Program.cs CodeGen runner entry point.
samples/src/Contoso.Shopping.CodeGen/Contoso.Shopping.CodeGen.csproj New CodeGen sample project.
samples/src/Contoso.Shopping.Application/Repositories/IReferenceDataRepository.g.cs New generated repo interface.
samples/src/Contoso.Shopping.Application/Repositories/IReferenceDataRepository.cs Removed hand-written interface.
samples/src/Contoso.Shopping.Application/ReferenceDataService.g.cs Updated/generated provider service.
samples/src/Contoso.Shopping.Application/BasketService.cs Updated to TransactionAsync.
samples/src/Contoso.Shopping.Api/GlobalUsing.cs Added missing global using.
samples/src/Contoso.Shopping.Api/Controllers/ReferenceDataController.g.cs New generated ref-data controller.
samples/src/Contoso.Products.Infrastructure/Repositories/ReferenceDataRepository.g.cs New generated repo implementation.
samples/src/Contoso.Products.Infrastructure/Repositories/ReferenceDataRepository.cs Converted to partial shell (ctor).
samples/src/Contoso.Products.Infrastructure/Repositories/ProductsDbContext.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/UnitOfMeasure.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/SubCategory.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/Product.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/MovementStatus.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/MovementKind.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/Movement.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/Inventory.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/Category.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Persistence/Brand.g.cs Updated generated header text.
samples/src/Contoso.Products.Infrastructure/Mapping/UnitOfMeasureMapper.g.cs New generated mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/UnitOfMeasureMapper.cs Removed hand-written mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/SubCategoryMapper.g.cs New generated mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/SubCategoryMapper.cs Removed hand-written mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/MovementStatusMapper.g.cs New generated mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/MovementStatusMapper.cs Removed hand-written mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/MovementKindMapper.g.cs New generated mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/MovementKindMapper.cs Removed hand-written mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/CategoryMapper.g.cs New generated mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/CategoryMapper.cs Removed hand-written mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/BrandMapper.g.cs New generated mapper.
samples/src/Contoso.Products.Infrastructure/Mapping/BrandMapper.cs Removed hand-written mapper.
samples/src/Contoso.Products.Database/Schema/Functions/fn_outbox_lease_release.g.pgsql Updated generated header text.
samples/src/Contoso.Products.Database/Schema/Functions/fn_outbox_lease_acquire.g.pgsql Updated generated header text.
samples/src/Contoso.Products.Database/Schema/Functions/fn_outbox_enqueue.g.pgsql Updated generated header text.
samples/src/Contoso.Products.Database/Schema/Functions/fn_outbox_batch_complete.g.pgsql Updated generated header text.
samples/src/Contoso.Products.Database/Schema/Functions/fn_outbox_batch_claim.g.pgsql Updated generated header text.
samples/src/Contoso.Products.Database/Schema/Functions/fn_outbox_batch_cancel.g.pgsql Updated generated header text.
samples/src/Contoso.Products.Contracts/UnitOfMeasure.g.cs New generated contract type.
samples/src/Contoso.Products.Contracts/UnitOfMeasure.cs Retained custom partial members.
samples/src/Contoso.Products.Contracts/SubCategory.g.cs New generated contract type.
samples/src/Contoso.Products.Contracts/SubCategory.cs Removed hand-written contract.
samples/src/Contoso.Products.Contracts/MovementStatus.g.cs New generated contract type.
samples/src/Contoso.Products.Contracts/MovementStatus.cs Retained custom partial members.
samples/src/Contoso.Products.Contracts/MovementKind.g.cs New generated contract type.
samples/src/Contoso.Products.Contracts/MovementKind.cs Retained custom partial members.
samples/src/Contoso.Products.Contracts/Category.g.cs New generated contract type.
samples/src/Contoso.Products.Contracts/Category.cs Removed hand-written contract.
samples/src/Contoso.Products.Contracts/Brand.g.cs New generated contract type.
samples/src/Contoso.Products.Contracts/Brand.cs Removed hand-written contract.
samples/src/Contoso.Products.CodeGen/ref-data.yaml New codegen config.
samples/src/Contoso.Products.CodeGen/Program.cs CodeGen runner entry point.
samples/src/Contoso.Products.CodeGen/Contoso.Products.CodeGen.csproj New CodeGen sample project.
samples/src/Contoso.Products.Application/Repositories/IReferenceDataRepository.g.cs New generated repo interface.
samples/src/Contoso.Products.Application/Repositories/IReferenceDataRepository.cs Removed hand-written interface.
samples/src/Contoso.Products.Application/ReferenceDataService.g.cs Updated/generated provider service.
samples/src/Contoso.Products.Application/ProductService.cs Updated to TransactionAsync.
samples/src/Contoso.Products.Application/MovementService.cs Updated to TransactionAsync.
samples/src/Contoso.Orders.Infrastructure/Repositories/OrdersDbContext.g.cs Updated generated header text.
samples/src/Contoso.Orders.Infrastructure/Persistence/OrderStatus.g.cs Updated generated header text.
samples/src/Contoso.Orders.Infrastructure/Persistence/OrderItem.g.cs Updated generated header text.
samples/src/Contoso.Orders.Infrastructure/Persistence/Order.g.cs Updated generated header text.
samples/src/Contoso.Orders.Application/OrderService.cs Updated to TransactionAsync.
samples/docs/domain-layer.md New sample architecture documentation.
nuget-publish.ps1 Added CoreEx.CodeGen to publish list.
gen/CoreEx.Generator/CoreEx.Generator.csproj Imports root version props.
Directory.Packages.props Updated DbEx + added OnRamp version.
CoreEx.Samples.Build.slnf Includes new CodeGen sample projects.
.github/workflows/CI.yml Runs CodeGen tools with no-diff expectation.

Comment thread src/CoreEx.RefData/ReferenceDataT2.cs
Comment thread src/CoreEx.RefData/ReferenceDataT2.cs
Comment thread src/CoreEx.CodeGen/CommandType.cs
Comment thread src/CoreEx/HealthChecks/README.md
Comment thread src/CoreEx.CodeGen/docs/Entity.md
Comment thread src/CoreEx.Data/IUnitOfWork.WithoutCancellation.cs
Comment thread tools/CoreEx.Tooling.Console/Program.cs
Comment thread src/CoreEx.Caching.FusionCache/README.md
Copilot AI review requested due to automatic review settings May 25, 2026 20:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 227 out of 227 changed files in this pull request and generated 5 comments.

Comment thread src/CoreEx.RefData/ReferenceDataT.cs
Comment thread src/CoreEx.RefData/ReferenceDataT2.cs
Comment thread src/CoreEx.CodeGen/Counting/CodeGenCounter.cs
Comment thread src/CoreEx.CodeGen/Counting/CodeGenCounter.cs
Comment on lines +24 to +30
/// </summary>
{{#if IsRefData}}
[ReferenceData<{{Type}}>]
public partial string{{#if IsNullable}}?{{/if}} {{Name}} { get; init; }
{{else}}
public {{Type}}{{#if IsNullable}}?{{/if}} {{Name}} { get; init; }
{{/if}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants