Skip to content

Commit f65d657

Browse files
dmealingclaude
andcommitted
docs(csharp): correct EF compile-check failure diagnostic + dedup model comment
The .ToJson()-on-a-primitive-collection failure the guard catches surfaces as CS1929 (extension-method receiver mismatch — ToJson requires an OwnedNavigationBuilder), not CS1061, and the receiver is a PrimitiveCollectionBuilder<List<T>>, not a PropertyBuilder<List<T>>. Correct both in the file-header comment. Also collapse the duplicate EF-surface bullet list above the Model field into a pointer to the header, removing the drift-prone restatement. Comment-only; behavior and the test are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b9cb724 commit f65d657

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

server/csharp/MetaObjects.Codegen.Tests/DbContextCompileTests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
// Compiles the generated entity POCOs + AppDbContext TOGETHER against real
44
// EF Core 8 assemblies (in-memory Roslyn, same pattern as EntityGeneratorTests).
55
// This catches API mismatches that pure string-contains checks can't find —
6-
// e.g. calling .ToJson() on a PropertyBuilder<List<T>>, which EF Core 8 does not
7-
// expose (CS1061), even though the string appears valid.
6+
// e.g. calling .ToJson() on a PrimitiveCollectionBuilder<List<T>>, which EF Core 8
7+
// does not expose (CS1929: that extension method's receiver must be an
8+
// OwnedNavigationBuilder), even though the string appears valid.
89
//
910
// The fixture exercises the full EF surface in one model:
1011
// - object.value Address (owned type target)
@@ -32,13 +33,8 @@ namespace MetaObjects.Codegen.Tests;
3233

3334
public class DbContextCompileTests
3435
{
35-
// One model that exercises every EF-surface code-path in DbContextGenerator:
36-
// • scalar enum → .HasConversion<string>()
37-
// • array enum → .PrimitiveCollection().ElementType().HasConversion<string>()
38-
// • scalar array → .PrimitiveCollection()
39-
// • flattened object field → OwnsOne per-property column config
40-
// • json object field → OwnsOne(...).ToJson(...)
41-
// • dbView projection → .ToView(...)
36+
// One model that exercises every EF-surface code-path in DbContextGenerator
37+
// (see the file-header comment for the field-by-field breakdown).
4238
private const string Model = """
4339
{ "metadata.root": { "package": "acme", "children": [
4440
{ "object.value": { "name": "Address", "children": [

0 commit comments

Comments
 (0)