Commit f99b5dd
Fix: Use MemoryStream as ClrType for complex JSON types
Changed _jsonComplex to use MySqlJsonTypeMapping<MemoryStream> instead of byte[].
This makes the ClrType match what EF Core expects for complex JSON types,
while still reading as string and converting in CustomizeDataReaderExpression.
Updated the condition to check for MemoryStream type instead of non-string.
This should resolve both the coercion error and SQL generation issues because:
- ClrType = MemoryStream matches EF Core's expectations for complex JSON
- Still reads as string from MySQL (GetDataReaderMethod returns GetString)
- Converts string to MemoryStream only when ClrType == MemoryStream
- Regular JSON columns use MySqlJsonTypeMapping<string> with no conversion
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>1 parent c4aa7e0 commit f99b5dd
2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
0 commit comments