Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 43 additions & 30 deletions release-notes/10.0/preview/preview6/efcore.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
# Entity Framework Core 10 Preview 6 - Release Notes

Here's a summary of what's new in Entity Framework Core in this preview release:

- [Improved experience when evolving the model on Azure Cosmos DB for NoSQL](#improved-experience-when-evolving-the-model-on-azure-cosmos-db-for-nosql)
- [Small improvements](#small-improvements)

Entity Framework Core 10 updates:

- [What's new in Entity Framework Core 10](https://learn.microsoft.com/ef/core/what-is-new/ef-core-10.0/whatsnew) documentation
- [Breaking change in Entity Framework Core 10](https://learn.microsoft.com/ef/core/what-is-new/ef-core-10.0/breaking-changes)

## Improved experience when evolving the model on Azure Cosmos DB for NoSQL

In previous versions of EF Core, evolving the model when using Azure Cosmos DB was quite painful. Specifically, when adding a new required property to the entity, EF would no longer be able to materialize that entity. The reason was that EF expected a value for the new property (since it was required), but the document created before the change didn't contain those values. The workaround was to mark the property as optional first, manually add default values for the property, and only then change it to required.

In EF 10 Preview 6 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.

## Small improvements

- Redact inlined constants from log when sensitive logging is off ([#35724](https://github.com/dotnet/efcore/pull/35724)).
- Improve LoadExtension to work correctly with dotnet run and lib* named libs ([#35617](https://github.com/dotnet/efcore/pull/35617), contributed by [@krwq](https://github.com/krwq)).

## Everything else in Preview 6

Preview 6 contains:

- [4 enhancements](https://github.com/dotnet/efcore/issues?q=is%3Aissue%20is%3Aclosed%20label%3Apreview-3%20(milestone%3A9.0.5%20OR%20milestone%3A10.0.0)%20label%3Atype-enhancement)
- [2 regression bug fixes](https://github.com/dotnet/efcore/issues?q=is%3Aissue%20is%3Aclosed%20label%3Apreview-3%20(milestone%3A9.0.5%20OR%20milestone%3A10.0.0)%20label%3Atype-bug%20label%3Aregression)
- [2 non-regression bug fixes](https://github.com/dotnet/efcore/issues?q=is%3Aissue%20is%3Aclosed%20label%3Apreview-3%20(milestone%3A10.0.0)%20label%3Atype-bug%20-label%3Aregression)
# Entity Framework Core 10 Preview 6 - Release Notes

Here's a summary of what's new in Entity Framework Core in this preview release:

- [Named query filters](#named-query-filters)
- [Small improvements](#small-improvements)

Entity Framework Core 10 updates:

- [What's new in Entity Framework Core 10](https://learn.microsoft.com/ef/core/what-is-new/ef-core-10.0/whatsnew) documentation
- [Breaking change in Entity Framework Core 10](https://learn.microsoft.com/ef/core/what-is-new/ef-core-10.0/breaking-changes)

## Named query filters

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.

EF 10 introduces *named query filters*, which allow attaching names to query filter and managing each one separately:

```c#
modelBuilder.Entity<Blog>()
.HasQueryFilter("SoftDeletionFlter", b => !b.IsDeleted)
.HasQueryFilter("TenantFilter", b => b.TenantId == tenantId);
```

This notably allows disabling only certain filters in a specific LINQ query:

```c#
var allBlogs = await context.Blogs.IgnoreQueryFilters(["SoftDeletionFlter"]).ToListAsync();
```

For more information on named query filters, see the [documentation](https://learn.microsoft.com/ef/core/querying/filters).

This feature was contributed by [@bittola](https://github.com/bittola).

## Small improvements and bug fixes

* Implemented `DateOnly.DayNumber` translations ([#36189](https://github.com/dotnet/efcore/pull/36189)).
* IQueryExpressionInterceptor leaks across contexts, leading to incorrectly-used cached queries ([#36127](https://github.com/dotnet/efcore/issues/36127)).
* Support entity splitting with owned JSON entities (on main table) ([#36145](https://github.com/dotnet/efcore/issues/36145)).

## Everything else in Preview 6

The full list of issues completed for Preview 6 can be found [here](https://github.com/dotnet/efcore/issues?q=is%3Aissue%20state%3Aclosed%20milestone%3A10.0.0%20label%3Apreview-6).