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
Copy file name to clipboardExpand all lines: entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md
+66-18Lines changed: 66 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,24 +224,6 @@ In previous versions of EF Core, evolving the model when using Azure Cosmos DB w
224
224
225
225
In EF 10 we improved this experience - EF will now materialize a default value for a required property, if no data is present for it in the document, rather than throw.
226
226
227
-
<aname="named-query-filters"></a>
228
-
229
-
## Named query filters
230
-
231
-
EF's [global query filters](xref:core/querying/filters) feature has long enabled users to configuring filters to entity types which apply to all queries by default. This has simplified implementing common patterns and scenarios such as soft deletion, multitenancy and others. However, up to now EF has only supported a single query filter per entity type, making it difficult to have multiple filters and selectively disabling only some of them in specific queries.
232
-
233
-
EF 10 introduces *named query filters*, which allow attaching names to query filter and managing each one separately:
For more information on named query filters, [see the documentation](xref:core/querying/filters).
242
-
243
-
This feature was contributed by [@bittola](https://github.com/bittola).
244
-
245
227
<aname="linq-and-sql-translation"></a>
246
228
247
229
## LINQ and SQL translation
@@ -414,6 +396,72 @@ ORDER BY [b0].[Name], [b0].[Id]
414
396
- Optimize `MIN`/`MAX` over `DISTINCT` ([#34699](https://github.com/dotnet/efcore/pull/34699), contributed by [@ranma42](https://github.com/ranma42)).
415
397
- Simplify parameter names (e.g. from `@__city_0` to `@city`) ([#35200](https://github.com/dotnet/efcore/pull/35200)).
416
398
399
+
<aname="execute-update-json"></a>
400
+
401
+
## ExecuteUpdate support for relational JSON columns
402
+
403
+
> [!NOTE]
404
+
> ExecuteUpdate support for JSON requires mapping your types as complex types, and does not work when you types are mapped as owned entities.
405
+
406
+
Although EF has support JSON columns for some time and allows updating them via `SaveChanges`, `ExecuteUpdate` lacked support for them. EF10 now allows referencing JSON columns and properties within them in `ExecuteUpdate`, allowing efficient bulk updating of document-modeled data within relational databases.
407
+
408
+
For example, given the following model, mapping the `BlogDetails` type to a complex JSON column in the database:
This generates the following for SQL Server 2025, using the efficient, new `modify` function to increment the JSON property `Views` by one:
438
+
439
+
```sql
440
+
UPDATE [b]
441
+
SET [Details].modify('$.Views', JSON_VALUE([b].[Details], '$.Views' RETURNING int) +1)
442
+
FROM [Blogs] AS [b]
443
+
```
444
+
445
+
Older versions of SQL Server are also supported, where the JSON data is stored in an `nvarchar(max)` column rather than the new JSON data type support. For support with other databases, consult the documentation for your EF provider.
446
+
447
+
<aname="named-query-filters"></a>
448
+
449
+
## Named query filters
450
+
451
+
EF's [global query filters](xref:core/querying/filters) feature has long enabled users to configuring filters to entity types which apply to all queries by default. This has simplified implementing common patterns and scenarios such as soft deletion, multitenancy and others. However, up to now EF has only supported a single query filter per entity type, making it difficult to have multiple filters and selectively disabling only some of them in specific queries.
452
+
453
+
EF 10 introduces *named query filters*, which allow attaching names to query filter and managing each one separately:
For more information on named query filters, [see the documentation](xref:core/querying/filters).
462
+
463
+
This feature was contributed by [@bittola](https://github.com/bittola).
464
+
417
465
## ExecuteUpdateAsync now accepts a regular, non-expression lambda
418
466
419
467
The <xref:Microsoft.EntityFrameworkCore.RelationalQueryableExtensions.ExecuteUpdateAsync*> can be used to express arbitrary update operations in the database. In previous versions, the changes to be performed on the database rows were provided via an expression tree parameter; this made it quite difficult to build those changes dynamically. For example, let's assume we want to update a Blog's Views, but conditionally also its Name. Since the setters argument was an expression tree, code such as the following needed to be written:
0 commit comments