Commit 0300f55
Fix: Override GetDataReaderMethod in MySqlJsonTypeMapping to use GetString
MySQL stores JSON as strings, but EF Core's default behavior tries to read them as MemoryStream for complex types. This causes a "No coercion operator is defined between types 'System.String' and 'System.IO.MemoryStream'" error.
The fix overrides GetDataReaderMethod() to explicitly return DbDataReader.GetString, ensuring JSON values are read as strings.
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>1 parent f2abbdc commit 0300f55
1 file changed
Lines changed: 12 additions & 0 deletions
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
121 | 133 | | |
122 | 134 | | |
123 | 135 | | |
| |||
0 commit comments