Commit 7d2dae1
Critical fix: Revert to dbType: null and add ClrType property override
KEY FINDING from Npgsql comparison: Must use `dbType: null` (not DbType.String)!
Changes:
1. Reverted `dbType: System.Data.DbType.String` → `dbType: null` to match Npgsql exactly
2. Added explicit `ClrType` property override returning `typeof(JsonTypePlaceholder)`
Npgsql's NpgsqlStructuralJsonTypeMapping uses dbType: null, which is critical
for EF Core's SQL generator to properly handle JsonTypePlaceholder during column
projection. Using DbType.String was causing the empty column issue.
The explicit ClrType property override ensures the type is consistently returned
as JsonTypePlaceholder, preventing EF Core from inferring different types.
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>1 parent c9d31cb commit 7d2dae1
1 file changed
Lines changed: 7 additions & 2 deletions
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
0 commit comments