Skip to content

feat(csharp): REST-standard list queries and a default page of 50 - #653

Merged
dmealing merged 10 commits into
mainfrom
fm/mo-130-csharp-rows
Nov 25, 2026
Merged

dmealing merged 10 commits into
mainfrom
fm/mo-130-csharp-rows

Conversation

@dmealing

@dmealing dmealing commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Generated C# list routes (entity, projection, report, TPH base and subtype) now parse the whole list query through a new ListQueryParser in the MetaObjects.AspNetCore package. It handles ?search=, filter[or]/filter[and] groups to a depth of five, sort with @sortableDefaultOrder, and page bounds, and it answers the named refusals (filter.bare_field, invalid_json, invalid_id, and others). The generated lane runs the shared list-query/ corpus, and the flat FilterParser path is marked [Obsolete].
  • A list request with no limit answers 50 rows (ApiSettings.DefaultPageLimit) when the project sets no api.pagination. Without that setting, a malformed limit or offset is now 400 pagination.invalid_value instead of being ignored. This is a breaking change, and the upgrade note is in changelog.d.
  • The route helpers move out of MetaObjects.Codegen/Runtime into the new MetaObjects.AspNetCore package. MetaObjects.Codegen and the dotnet meta tool no longer reference EF Core or ASP.NET Core. gen and verify warn when an app lacks the new reference, eject copies the helpers into codegen/runtime, and the publish workflow and prerelease script pack the new package.

Gate: this PR took 1 no-mistakes run (one review fix round, on the decision to deprecate rather than remove the flat-filter path).

Validation

Risk Assessment

✅ Low: The fix round only adds [Obsolete] to the unused flat-filter path, repoints tests at the live ListQuery overloads and adds a changelog note. The live path is unchanged, no generated code or in-package caller uses the obsolete members, and I found no new defects. I read only the fix-round diff and its surroundings, not the earlier-round files.

Testing

Baseline affected run passed and was not repeated. The C# generated list lane ran 21 of 21 shared list-query scenarios over HTTP against a real Postgres, covering the default page of 50, page past 50, filter or/and groups, the nesting cap, bare-field, leading-wildcard, pagination, invalid_json, invalid_id and constraint refusals. A disposable app built with the local CLI showed the helper-runtime warning on gen and verify when the reference is missing. The same app fails to compile without the reference and builds with it. Dependency graphs carry no EF Core. Overall result: pass, with no failures.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
D11-CS: a list with no limit answers 50 rows over HTTP (default-page-of-fifty, page-past-fifty, count-matches-the-filter) on the generated C# server with real EF Core and Postgres 16 via Testcontainer… ✅ pass live dotnet test MetaObjects.IntegrationTests --filter ApiContractListQueryConformanceTest, 21/21 passed; csharp-list-query-generated-lane.log
R-CS-1/R-CS-2: the generated C# list route parses the whole REST list query and refuses bad input by name over HTTP (or/and groups, nesting-too-deep and nesting-at-the-cap, bare-field, leading-wildcar… ✅ pass live Same 21/21 run as above; csharp-list-query-generated-lane.log
Runtime split: a generated app without the MetaObjects.AspNetCore reference gets a gen and verify warning, and the app fails to compile; adding the reference clears the warning and the app builds ✅ pass live Built dotnet meta from the worktree; disposable scratch app; logs csharp-gen-without-helper-reference.log, csharp-gen-with-helper-reference.log, csharp-verify-without-helper-reference.log, csha…
Evidence: C# list-query generated lane: 21/21 pass over HTTP vs Testcontainers Postgres
  Determining projects to restore...
  Restored {run-worktree}/server/csharp/MetaObjects.IntegrationTests/MetaObjects.IntegrationTests.csproj (in 515 ms).
  4 of 5 projects are up-to-date for restore.
  MetaObjects.AspNetCore -> {run-worktree}/server/csharp/MetaObjects.AspNetCore/bin/Debug/net8.0/MetaObjects.AspNetCore.dll
  MetaObjects.Render -> {run-worktree}/server/csharp/MetaObjects.Render/bin/Debug/net8.0/MetaObjects.Render.dll
  MetaObjects -> {run-worktree}/server/csharp/MetaObjects/bin/Debug/net8.0/MetaObjects.dll
  MetaObjects.Codegen -> {run-worktree}/server/csharp/MetaObjects.Codegen/bin/Debug/net8.0/MetaObjects.Codegen.dll
  MetaObjects.IntegrationTests -> {run-worktree}/server/csharp/MetaObjects.IntegrationTests/bin/Debug/net8.0/MetaObjects.IntegrationTests.dll
Test run for {run-worktree}/server/csharp/MetaObjects.IntegrationTests/bin/Debug/net8.0/MetaObjects.IntegrationTests.dll (.NETCoreApp,Version=v8.0)
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.5.6+bf9b858c26 (64-bit .NET 8.0.34)
[xUnit.net 00:00:00.06]   Discovering: MetaObjects.IntegrationTests
[xUnit.net 00:00:00.29]   Discovered:  MetaObjects.IntegrationTests
[xUnit.net 00:00:00.29]   Starting:    MetaObjects.IntegrationTests
[testcontainers.org 00:00:00.08] Connected to Docker:
  Host: unix:///var/run/docker.sock
  Server Version: 29.1.3
  Kernel Version: 7.2.15-76070215-generic
  API Version: 1.52
  Operating System: Pop!_OS 22.04 LTS
  Total Memory: 60.40 GB
[testcontainers.org 00:00:00.22] Docker container 73c5d4e4c2f6 created
[testcontainers.org 00:00:00.24] Start Docker container 73c5d4e4c2f6
[testcontainers.org 00:00:01.42] Wait for Docker container 73c5d4e4c2f6 to complete readiness checks
[testcontainers.org 00:00:02.44] Docker container 73c5d4e4c2f6 ready
[testcontainers.org 00:00:02.53] Docker container 922e2ad7506a created
[testcontainers.org 00:00:02.53] Start Docker container 922e2ad7506a
[testcontainers.org 00:00:04.28] Wait for Docker container 922e2ad7506a to complete readiness checks
[testcontainers.org 00:00:04.29] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 922e2ad7506a
[testcontainers.org 00:00:05.33] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 922e2ad7506a
[testcontainers.org 00:00:05.37] Docker container 922e2ad7506a ready
[testcontainers.org 00:00:07.73] Delete Docker container 922e2ad7506a
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [8 s]
[testcontainers.org 00:00:08.87] Docker container 690e932b6526 created
[testcontainers.org 00:00:08.87] Start Docker container 690e932b6526
[testcontainers.org 00:00:09.15] Wait for Docker container 690e932b6526 to complete readiness checks
[testcontainers.org 00:00:09.16] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 690e932b6526
[testcontainers.org 00:00:10.19] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 690e932b6526
[testcontainers.org 00:00:10.23] Docker container 690e932b6526 ready
[testcontainers.org 00:00:10.79] Delete Docker container 690e932b6526
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [3 s]
[testcontainers.org 00:00:12.17] Docker container ac39679d7494 created
[testcontainers.org 00:00:12.17] Start Docker container ac39679d7494
[testcontainers.org 00:00:12.34] Wait for Docker container ac39679d7494 to complete readiness checks
[testcontainers.org 00:00:12.34] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container ac39679d7494
[testcontainers.org 00:00:13.37] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container ac39679d7494
[testcontainers.org 00:00:13.40] Docker container ac39679d7494 ready
[testcontainers.org 00:00:13.92] Delete Docker container ac39679d7494
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [3 s]
[testcontainers.org 00:00:15.79] Docker container bb04e9117e91 created
[testcontainers.org 00:00:15.79] Start Docker container bb04e9117e91
[testcontainers.org 00:00:15.99] Wait for Docker container bb04e9117e91 to complete readiness checks
[testcontainers.org 00:00:15.99] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container bb04e9117e91
[testcontainers.org 00:00:17.02] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container bb04e9117e91
[testcontainers.org 00:00:17.06] Docker container bb04e9117e91 ready
[testcontainers.org 00:00:17.50] Delete Docker container bb04e9117e91
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [2 s]
[testcontainers.org 00:00:17.77] Docker container bfabcf1c6ff7 created
[testcontainers.org 00:00:17.77] Start Docker container bfabcf1c6ff7
[testcontainers.org 00:00:19.70] Wait for Docker container bfabcf1c6ff7 to complete readiness checks
[testcontainers.org 00:00:19.70] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container bfabcf1c6ff7
[testcontainers.org 00:00:20.73] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container bfabcf1c6ff7
[testcontainers.org 00:00:20.76] Docker container bfabcf1c6ff7 ready
[testcontainers.org 00:00:21.09] Delete Docker container bfabcf1c6ff7
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [4 s]
[testcontainers.org 00:00:22.14] Docker container 3418511bf9ae created
[testcontainers.org 00:00:22.14] Start Docker container 3418511bf9ae
[testcontainers.org 00:00:22.33] Wait for Docker container 3418511bf9ae to complete readiness checks
[testcontainers.org 00:00:22.33] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 3418511bf9ae
[testcontainers.org 00:00:23.37] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 3418511bf9ae
[testcontainers.org 00:00:23.41] Docker container 3418511bf9ae ready
[testcontainers.org 00:00:23.80] Delete Docker container 3418511bf9ae
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [2 s]
[testcontainers.org 00:00:25.09] Docker container 07c8aeecf253 created
[testcontainers.org 00:00:25.09] Start Docker container 07c8aeecf253
[testcontainers.org 00:00:25.45] Wait for Docker container 07c8aeecf253 to complete readiness checks
[testcontainers.org 00:00:25.45] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 07c8aeecf253
[testcontainers.org 00:00:26.51] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 07c8aeecf253
[testcontainers.org 00:00:26.55] Docker container 07c8aeecf253 ready
[testcontainers.org 00:00:26.95] Delete Docker container 07c8aeecf253
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generat

... [4032 bytes truncated] ...

[testcontainers.org 00:00:41.87] Docker container 30a0a6290ad9 ready
[testcontainers.org 00:00:42.22] Delete Docker container 30a0a6290ad9
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [2 s]
[testcontainers.org 00:00:43.14] Docker container 070ec546026c created
[testcontainers.org 00:00:43.16] Start Docker container 070ec546026c
[testcontainers.org 00:00:43.34] Wait for Docker container 070ec546026c to complete readiness checks
[testcontainers.org 00:00:43.34] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 070ec546026c
[testcontainers.org 00:00:44.37] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 070ec546026c
[testcontainers.org 00:00:44.40] Docker container 070ec546026c ready
[testcontainers.org 00:00:44.70] Delete Docker container 070ec546026c
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [3 s]
[testcontainers.org 00:00:46.48] Docker container da57c60ef344 created
[testcontainers.org 00:00:46.48] Start Docker container da57c60ef344
[testcontainers.org 00:00:46.69] Wait for Docker container da57c60ef344 to complete readiness checks
[testcontainers.org 00:00:46.69] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container da57c60ef344
[testcontainers.org 00:00:47.72] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container da57c60ef344
[testcontainers.org 00:00:47.76] Docker container da57c60ef344 ready
[testcontainers.org 00:00:48.12] Delete Docker container da57c60ef344
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [2 s]
[testcontainers.org 00:00:48.80] Docker container c0c6031c4d39 created
[testcontainers.org 00:00:48.80] Start Docker container c0c6031c4d39
[testcontainers.org 00:00:49.03] Wait for Docker container c0c6031c4d39 to complete readiness checks
[testcontainers.org 00:00:49.03] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container c0c6031c4d39
[testcontainers.org 00:00:50.06] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container c0c6031c4d39
[testcontainers.org 00:00:50.10] Docker container c0c6031c4d39 ready
[testcontainers.org 00:00:50.51] Delete Docker container c0c6031c4d39
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [3 s]
[testcontainers.org 00:00:51.80] Docker container e742847d363d created
[testcontainers.org 00:00:51.80] Start Docker container e742847d363d
[testcontainers.org 00:00:51.99] Wait for Docker container e742847d363d to complete readiness checks
[testcontainers.org 00:00:51.99] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container e742847d363d
[testcontainers.org 00:00:53.03] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container e742847d363d
[testcontainers.org 00:00:53.06] Docker container e742847d363d ready
[testcontainers.org 00:00:53.40] Delete Docker container e742847d363d
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [3 s]
[testcontainers.org 00:00:54.88] Docker container 47d2ffad5661 created
[testcontainers.org 00:00:54.88] Start Docker container 47d2ffad5661
[testcontainers.org 00:00:55.24] Wait for Docker container 47d2ffad5661 to complete readiness checks
[testcontainers.org 00:00:55.24] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 47d2ffad5661
[testcontainers.org 00:00:56.27] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 47d2ffad5661
[testcontainers.org 00:00:56.31] Docker container 47d2ffad5661 ready
[testcontainers.org 00:00:56.61] Delete Docker container 47d2ffad5661
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [2 s]
[testcontainers.org 00:00:57.74] Docker container 443f1a4e7bde created
[testcontainers.org 00:00:57.74] Start Docker container 443f1a4e7bde
[testcontainers.org 00:00:57.96] Wait for Docker container 443f1a4e7bde to complete readiness checks
[testcontainers.org 00:00:57.96] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 443f1a4e7bde
[testcontainers.org 00:00:58.99] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 443f1a4e7bde
[testcontainers.org 00:00:59.03] Docker container 443f1a4e7bde ready
[testcontainers.org 00:00:59.34] Delete Docker container 443f1a4e7bde
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [2 s]
[testcontainers.org 00:01:00.70] Docker container 7538ed4e5677 created
[testcontainers.org 00:01:00.70] Start Docker container 7538ed4e5677
[testcontainers.org 00:01:00.92] Wait for Docker container 7538ed4e5677 to complete readiness checks
[testcontainers.org 00:01:00.92] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 7538ed4e5677
[testcontainers.org 00:01:01.95] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container 7538ed4e5677
[testcontainers.org 00:01:01.98] Docker container 7538ed4e5677 ready
[testcontainers.org 00:01:02.37] Delete Docker container 7538ed4e5677
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [3 s]
[testcontainers.org 00:01:03.80] Docker container a46ba9976c65 created
[testcontainers.org 00:01:03.80] Start Docker container a46ba9976c65
[testcontainers.org 00:01:04.04] Wait for Docker container a46ba9976c65 to complete readiness checks
[testcontainers.org 00:01:04.04] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container a46ba9976c65
[testcontainers.org 00:01:05.08] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container a46ba9976c65
[testcontainers.org 00:01:05.11] Docker container a46ba9976c65 ready
[testcontainers.org 00:01:05.50] Delete Docker container a46ba9976c65
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [2 s]
[testcontainers.org 00:01:05.82] Docker container f6ef8f85e9f9 created
[testcontainers.org 00:01:05.83] Start Docker container f6ef8f85e9f9
[testcontainers.org 00:01:06.16] Wait for Docker container f6ef8f85e9f9 to complete readiness checks
[testcontainers.org 00:01:06.17] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container f6ef8f85e9f9
[testcontainers.org 00:01:07.20] Execute "pg_isready --host localhost --dbname postgres --username postgres" at Docker container f6ef8f85e9f9
[testcontainers.org 00:01:07.24] Docker container f6ef8f85e9f9 ready
[testcontainers.org 00:01:07.73] Delete Docker container f6ef8f85e9f9
[xUnit.net 00:01:09.29]   Finished:    MetaObjects.IntegrationTests
  Passed MetaObjects.IntegrationTests.Api.ApiContractListQueryConformanceTest.Api_contract_list_query_generated(scenarioPath: "{run-worktree}"···) [3 s]

Test Run Successful.
Total tests: 21
     Passed: 21
 Total time: 1.1614 Minutes
EXIT=0
Evidence: gen warns when app lacks MetaObjects.AspNetCore reference
dotnet meta: running the generator list in codegen/Generators.cs — `dotnet run --project codegen -- gen --out gen`.
  written: acme/stockroom/Part.g.cs
  written: AppDbContext.g.cs
  written: acme/stockroom/PartFilterAllowlist.g.cs
  written: acme/stockroom/PartRoutes.g.cs
  warning: acme/stockroom/PartFilterAllowlist.g.cs and 1 other generated file(s) import MetaObjects.AspNetCore, but <scratch>/app/App.csproj does not reference the MetaObjects.AspNetCore package, so it will not compile. Since 1.3.0 the helpers generated routes call (FilterParser, EfCoreFilterDispatch, ValueObjectValidator, ConstraintErrors, ...) are that package, no longer part of MetaObjects.Codegen. Add to App.csproj: <PackageReference Include="MetaObjects.AspNetCore" Version="1.3.0" />
dotnet meta gen: 4 file(s) written
Evidence: gen with reference: no warning
dotnet meta: running the generator list in codegen/Generators.cs — `dotnet run --project codegen -- gen --out gen`.
  unchanged: acme/stockroom/Part.g.cs
  unchanged: AppDbContext.g.cs
  unchanged: acme/stockroom/PartFilterAllowlist.g.cs
  unchanged: acme/stockroom/PartRoutes.g.cs
dotnet meta gen: 0 file(s) written
Evidence: verify --codegen warns without reference
dotnet meta: running the generator list in codegen/Generators.cs — `dotnet run --project codegen -- verify --codegen metaobjects --out gen`.
  warning: gen/acme/stockroom/PartFilterAllowlist.g.cs and 1 other generated file(s) import MetaObjects.AspNetCore, but <scratch>/app/App.csproj does not reference the MetaObjects.AspNetCore package, so it will not compile. Since 1.3.0 the helpers generated routes call (FilterParser, EfCoreFilterDispatch, ValueObjectValidator, ConstraintErrors, ...) are that package, no longer part of MetaObjects.Codegen. Add to App.csproj: <PackageReference Include="MetaObjects.AspNetCore" Version="1.3.0" />
dotnet meta verify --codegen: OK (nothing changed since the last gen; --full renders and compares)
Evidence: app build without reference fails (CS0246)
<scratch>/app/gen/acme/stockroom/PartFilterAllowlist.g.cs(5,7): error CS0246: The type or namespace name 'MetaObjects' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartRoutes.g.cs(9,7): error CS0246: The type or namespace name 'MetaObjects' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartFilterAllowlist.g.cs(37,56): error CS0246: The type or namespace name 'FilterFieldRule' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartRoutes.g.cs(15,83): error CS0246: The type or namespace name 'SortFieldRule' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartFilterAllowlist.g.cs(47,56): error CS0246: The type or namespace name 'SortFieldRule' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]

Build FAILED.

<scratch>/app/gen/acme/stockroom/PartFilterAllowlist.g.cs(5,7): error CS0246: The type or namespace name 'MetaObjects' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartRoutes.g.cs(9,7): error CS0246: The type or namespace name 'MetaObjects' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartFilterAllowlist.g.cs(37,56): error CS0246: The type or namespace name 'FilterFieldRule' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartRoutes.g.cs(15,83): error CS0246: The type or namespace name 'SortFieldRule' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
<scratch>/app/gen/acme/stockroom/PartFilterAllowlist.g.cs(47,56): error CS0246: The type or namespace name 'SortFieldRule' could not be found (are you missing a using directive or an assembly reference?) [<scratch>/app/App.csproj]
    0 Warning(s)
    5 Error(s)

Time Elapsed 00:00:02.13
Evidence: app build with reference succeeds

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:02.50

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ⚠️ server/csharp/MetaObjects.AspNetCore/EfCoreFilterDispatch.cs:39 - The change adds ListQueryParser plus EfCoreFilterDispatch.Apply and Validate(ListQuery), and every generated list route now calls those. The earlier flat-filter path is still carried and shipped in the new MetaObjects.AspNetCore package, and no generated code calls it: FilterParser.Parse, FilterPredicate, FilterParseResult, EfCoreFilterDispatch.ApplyFilter and Validate<T>(FilterParseResult), plus the allowlist's Fields/OpsByField members that only FilterParser reads. It is a second, weaker parser of the same filter grammar (no or/and groups, no bare-field, wildcard or depth refusals). It is also embedded and copied by eject. Nothing in the intent (R-CS-1, R-CS-2, or the package split) requires keeping it. Two tests now check the dead overload instead of the live one: DecimalWireTests.cs:155 and DurationWireTests.cs:171 call Validate(FilterParseResult), and PropertyNamingEmitSitesTests.cs:373-378 calls ApplyFilter. The shared CoerceTo is common to both overloads, but the live Validate(ListQuery) path has no direct decimal or duration operand test of its own. No intent requirement needs the old path; removing it is the smallest honest remedy. Because a hand-written endpoint could call it, whether to keep it as a compatibility surface is a product decision, so ask first. If it stays, repoint those tests at the ListQuery overloads.

🔧 Fix applied.
📝 1 wording or comment-placement note left for the author (no fix round spent):

  • ℹ️ docs/features/api-contract.md:226 - Doc named the now-[Obsolete] FilterParser.MaxInList as the C# in-list cap; repointed to ListQueryParser.DefaultMaxInList (the live parser's constant, value 100).
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
D11-CS: a list with no limit answers 50 rows over HTTP (default-page-of-fifty, page-past-fifty, count-matches-the-filter) on the generated C# server with real EF Core and Postgres 16 via Testcontainer… ✅ pass live dotnet test MetaObjects.IntegrationTests --filter ApiContractListQueryConformanceTest, 21/21 passed; csharp-list-query-generated-lane.log
R-CS-1/R-CS-2: the generated C# list route parses the whole REST list query and refuses bad input by name over HTTP (or/and groups, nesting-too-deep and nesting-at-the-cap, bare-field, leading-wildcar… ✅ pass live Same 21/21 run as above; csharp-list-query-generated-lane.log
Runtime split: a generated app without the MetaObjects.AspNetCore reference gets a gen and verify warning, and the app fails to compile; adding the reference clears the warning and the app builds ✅ pass live Built dotnet meta from the worktree; disposable scratch app; logs csharp-gen-without-helper-reference.log, csharp-gen-with-helper-reference.log, csharp-verify-without-helper-reference.log, csha…
  • scripts/ci-local.sh --affected --strict-toolchains
  • Baseline (already passed, not re-run): scripts/ci-local.sh --affected --strict-toolchains
  • dotnet test server/csharp/MetaObjects.IntegrationTests/MetaObjects.IntegrationTests.csproj --filter FullyQualifiedName~ApiContractListQueryConformanceTest (21/21 passed; generated C# server driven over HTTP against Testcontainers Postgres 16, covering the 21 fixtures/api-contract-conformance/list-query/scenarios)
  • dotnet build server/csharp/MetaObjects.Cli/MetaObjects.Cli.csproj -o <scratch>/cli (built dotnet meta from the worktree source)
  • In a disposable scratch app: dotnet meta init; codegen/Codegen.csproj ProjectReference to worktree MetaObjects.Codegen; Entity, DbContext, FilterAllowlist, Routes generators run via dotnet meta gen --out gen (warning printed, exit 0)
  • dotnet meta verify metaobjects --codegen --out gen without reference (warning printed; verify exit 0)
  • Added ProjectReference to MetaObjects.AspNetCore and re-ran gen (0 warnings)
  • dotnet build App.csproj with MetaObjects.AspNetCore reference (exit 0) and without it (CS0246 errors on FilterFieldRule, SortFieldRule, MetaObjects), confirming the warning is accurate
  • grep EntityFrameworkCore in built MetaObjects.Cli.deps.json and MetaObjects.Codegen.deps.json (0 refs each)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…ckage

The helpers generated routes call (FilterParser, EfCoreFilterDispatch,
ValueObjectValidator, ConstraintErrors and the rest of HelperRuntime.Files) move
from MetaObjects.Codegen/Runtime/ into a new MetaObjects.AspNetCore project and
NuGet package, namespace MetaObjects.AspNetCore, which references ASP.NET Core
and EF Core and no MetaObjects package. MetaObjects.Codegen drops its EF Core and
ASP.NET Core references, so the dotnet meta tool packs 6 DLLs instead of 14.
ExtractObject and M2MResolver stay in MetaObjects.Codegen as core.

- The packaged routes generator writes `using MetaObjects.AspNetCore;`, so regen
  moves the import; owned copies keep Codegen.Runtime. Eject reads the helper
  source embedded by link in MetaObjects.Codegen.
- gen and verify --codegen warn (advisory) when a generated file imports
  MetaObjects.AspNetCore and its project does not reference the package, and
  when generated output still imports the helpers from MetaObjects.Codegen.Runtime.
- CHANGELOG upgrade note, design note, docs, agent-context goldens, showcase
  regen, and the publish workflow, prerelease script and RELEASING pack five
  C# packages.
A generated entity, TPH or projection list in a project that sets no
api.pagination returned every row when the request carried no limit. It
now answers the first 50 (ApiSettings.DefaultPageLimit), the default of
every port; an explicit limit is served as asked. Without the setting a
malformed limit or offset is 400 pagination.invalid_value and limit=0 is
an empty page, as with it. The dotnet meta verify --codegen advisory
unbounded-list-pages is retired.

The C# generated lane runs the shared list-query sub-corpus: the paging
and refusal scenarios the routes answer today; search, or/and and the
named refusals are listed by name until R-CS. Docs, upgrade guide,
CHANGELOG, goldens and the showcase routes file follow.
MetaObjects.AspNetCore gains ListQueryParser, a port of runtime-ts's
parseListQuery. It reads or/and groups to a depth of five, search, sort
with @sortableDefaultOrder, and page bounds. It refuses bare-field
parameters, a leading %, and malformed values, naming each refusal with
the shared wire codes and details. Faults are reported in the shared
order. FilterValueFormat ports the format checks and the UTC spelling of
timestamp bounds. EfCoreFilterDispatch.Apply turns the parsed tree and the
search into one Where each.

Each generated <Entity>FilterAllowlist now also carries Rules, Sort and
FieldNames. FieldNames leaves out credentials. The sortable set follows
the TypeScript rule: @Sortable, otherwise @filterable. FilterRules,
SortRules and FieldNames are public, so ListQueryConformanceTests can
derive the allowlist the generator emits. That runner passes all 95 cases
in fixtures/list-query-conformance/.

The allowlist now imports the helper runtime, so it carries the eject
marker. Instant timestamps bind as DateTimeOffset at offset zero, and
local-time timestamps bind as an unspecified DateTime.

The generated routes still call the flat FilterParser. R-CS-2 wires them
to the new parser.
… invalid_json and invalid_id (R-CS-2)

Every generated C# list route (entity, projection, report, TPH base and
subtype) reads its query through ListQueryParser and applies it with
EfCoreFilterDispatch.Apply: ?search, filter[or]/filter[and] groups, and the
bare-field, leading-wildcard and nesting refusals. Sorting reads one
route-local SortRules table. A body that is not JSON answers
400 invalid_json and a path id the key cannot hold answers 400 invalid_id,
through the new RouteErrors helper that eject copies with the others.

The C# generated lane now runs the whole list-query/ sub-corpus, and
KNOWN_GAPS G2 is closed.
…reads the parsed bounds

Review fixes on the R-CS bundle:
- The filter allowlist now emits the helper-typed rule table the routes hand
  to ListQueryParser, so ejecting only one of the two put two copies of the
  helper types in one build. Eject and eject --undo now move both together.
- A report list read limit/offset twice, once in ListQueryParser and again
  from the raw query. It now reads the parsed bounds and keeps only the
  report's own checks (limit=0, the row cap), as the TypeScript report page does.
- The pre-1.3.0 import warning now leads with the regenerate advice, since a
  project on the packaged generators sees it too.
- Cli tests updated for the allowlist import and the ListQuery owned edit.
- KNOWN_GAPS G10 records that the C# routes sort on more fields than the
  contract's sortable set; narrowing it is breaking and waits on a ruling.
@dmealing
dmealing merged commit d9ddffa into main Nov 25, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-130-csharp-rows branch November 25, 2026 10:46
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.

1 participant