You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document breaking changes for complex types in EF Core 10.0 (#5113)
Column name uniquification
Nested complex type column naming
IDiscriminatorPropertySetConvention signature change
Value converters with private methods in compiled models
Fixes#4970Fixes#4947Fixesdotnet/efcore#35033
Co-authored-by: AndriySvyryd <[email protected]>
Copy file name to clipboardExpand all lines: entity-framework/core/performance/advanced-performance-topics.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,7 @@ Compiled models have some limitations:
295
295
296
296
*[Global query filters are not supported](https://github.com/dotnet/efcore/issues/24897).
297
297
*[Lazy loading and change-tracking proxies are not supported](https://github.com/dotnet/efcore/issues/24902).
298
+
* Value converters that reference private methods are not supported. Make referenced methods public or internal instead.
298
299
*[The model must be manually synchronized by regenerating it any time the model definition or configuration change](https://github.com/dotnet/efcore/issues/24894).
299
300
* Custom IModelCacheKeyFactory implementations are not supported. However, you can compile multiple models and load the appropriate one as needed.
Previously, when mapping complex types to table columns, if multiple properties in different complex types had the same column name, they would silently share the same column.
193
+
194
+
#### New behavior
195
+
196
+
Starting with EF Core 10.0, complex type column names are uniquified by appending a number at the end if another column with the same name exists on the table.
197
+
198
+
#### Why
199
+
200
+
This prevents data corruption that could occur when multiple properties are unintentionally mapped to the same column.
201
+
202
+
#### Mitigations
203
+
204
+
If you need multiple properties to share the same column, configure them explicitly:
### Nested complex type properties use full path in column names
217
+
218
+
#### Old behavior
219
+
220
+
Previously, properties on nested complex types were mapped to columns using just the declaring type name. For example, `EntityType.Complex.NestedComplex.Property` was mapped to column `NestedComplex_Property`.
221
+
222
+
#### New behavior
223
+
224
+
Starting with EF Core 10.0, properties on nested complex types use the full path to the property as part of the column name. For example, `EntityType.Complex.NestedComplex.Property` is now mapped to column `Complex_NestedComplex_Property`.
225
+
226
+
#### Why
227
+
228
+
This provides better column name uniqueness and makes it clearer which property maps to which column.
229
+
230
+
#### Mitigations
231
+
232
+
If you need to maintain the old column names, configure them explicitly:
0 commit comments