{"id":316,"date":"2025-08-18T10:04:39","date_gmt":"2025-08-18T10:04:39","guid":{"rendered":"https:\/\/www.dotnetdevelopers.us\/blogs\/?p=316"},"modified":"2025-09-01T07:58:51","modified_gmt":"2025-09-01T07:58:51","slug":"ef-core-net","status":"publish","type":"post","link":"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/","title":{"rendered":"Exciting New Features in EF Core for .NET 2025"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#1_Named_Query_Filters\" >1. Named Query Filters<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#How_it_works\" >How it works<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#2_Full-Text_Search_for_Azure_Cosmos_DB\" >2. Full-Text Search for Azure Cosmos DB<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#How_it_works-2\" >How it works<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#3_Improved_LINQ_and_SQL_Translation\" >3. Improved LINQ and SQL Translation<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#How_it_works-3\" >How it works<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#4_ExecuteUpdateAsync_Lambda_Overloads\" >4. ExecuteUpdateAsync Lambda Overloads<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#How_it_works-4\" >How it works<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#5_Source-Generated_Compiled_Models\" >5. Source-Generated Compiled Models<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#How_to_use_it\" >How to use it<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#6_JSON_Column_Mapping\" >6. JSON Column Mapping<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#How_It_Works\" >How It Works<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#Q1_What_are_the_key_performance_improvements_introduced_in_EF_Core_for_NET_2025\" >Q1 : What are the key performance improvements introduced in EF Core for .NET 2025?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#Q2_How_do_compiled_models_work_and_how_can_I_enable_them_in_my_project\" >Q2 : How do compiled models work, and how can I enable them in my project?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#Q3_What_enhancements_have_been_made_to_LINQ_queries_in_this_release\" >Q3 : What enhancements have been made to LINQ queries in this release?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#Q4_JSON_column_mapping_with_EF_Core_for_NET_2025\" >Q4 : JSON column mapping with EF Core for .NET 2025?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.dotnetdevelopers.us\/blogs\/ef-core-net\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>Entity Framework Core (EF Core) continues to be the primary ORM of choice for<a href=\"https:\/\/www.dotnetdevelopers.us\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.dotnetdevelopers.us\/\" rel=\"noreferrer noopener\"> .NET<\/a> applications, and with <a href=\"https:\/\/www.learnentityframeworkcore.com\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.learnentityframeworkcore.com\/\" rel=\"noreferrer noopener nofollow\">EF Core<\/a> 10 (available with .NET 10, aka .NET 2025) around the corner, you can expect many features which will enhance productivity, enable new database scenarios, and optimize performance. In a world of high-scale cloud services, modern web apps, and data-rich desktop applications, the new features will affect how you model data, optimize queries, and work across relational and NoSQL stores.<\/p>\n\n\n\n<p>In this article, we will explore the top six features shipping in EF Core 10. For each feature, we will discuss why it is important, how it works under the hood, and include some code examples to help you quickly onboard. By the end of these articles, you should have an understanding of the new features, and be ready to upgrade your projects and take advantage of everything it has to offer in EF Core 10.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Named_Query_Filters\"><\/span><strong>1. Named Query Filters<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Named query filters allow you to define multiple, separate global filters on the same entity, then enable or disable them by name in specific queries. This resolves long-standing pain points around cross-cutting concerns, especially we often unit test with soft delete, multitenancy, or dynamic flags.&nbsp;<\/p>\n\n\n\n<p>Why use this&nbsp;<\/p>\n\n\n\n<p>&#8211; You can implement soft delete once without having to repeat .Where(e =&gt; !e.IsDeleted) everywhere<\/p>\n\n\n\n<p>&#8211; You can enforce tenant boundaries by default and have the choice to exclude or combine filters<\/p>\n\n\n\n<p>&#8211; You can keep filter logic uniquely named and centralized, enhancing readability.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_it_works\"><\/span><strong>How it works<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You call .HasQueryFilter(name, lambda) in your OnModelCreating call. During query time, you can use the filter name in LINQ .IgnoreQueryFilters(\u2026) or selective .IgnoreQueryFilters(new[]{ &#8220;FilterA&#8221;}). EF Core formulates all the filters into the SQL WHERE clause for you, and you only exclude what you explicitly choose.<\/p>\n\n\n\n<p>modelBuilder.Entity&lt;Blog&gt;()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;.HasQueryFilter(&#8220;SoftDelete&#8221;, b =&gt; !b.IsDeleted)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;.HasQueryFilter(&#8220;Tenant&#8221;, b =&gt; b.TenantId == currentTenantId);<\/p>\n\n\n\n<p>\/\/ Later in code&#8230;<\/p>\n\n\n\n<p>var allBlogs = await context.Blogs<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;.IgnoreQueryFilters(&#8220;SoftDelete&#8221;)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;.ToListAsync();<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Full-Text_Search_for_Azure_Cosmos_DB\"><\/span><strong>2. Full-Text Search for Azure Cosmos DB<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Introducing full-text search support for Azure Cosmos DB in EF Core 10! You&#8217;re now able to specify searchable properties in your EF model, and compose rich, relevance-ranked text queries using LINQ.<\/p>\n\n\n\n<p>Why would you want to do this?<\/p>\n\n\n\n<p>&#8211; Provide fast and scalable text search over large JSON documents<\/p>\n\n\n\n<p>&#8211; Combine full-text search capabilities with Cosmos DB&#8217;s vector search for AI-based relevance<\/p>\n\n\n\n<p>&#8211; Avoid hand rolling REST calls or embedding raw SQL directly in your application&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_it_works-2\"><\/span><strong>How it works<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Decorate entity properties that you want indexed, then use the Search() method in LINQ. EF Core will convert your LINQ expression to what is necessary to use Cosmos DB&#8217;s search API, and you&#8217;ll get paginated results that handle filtering and ranking for you!<\/p>\n\n\n\n<p>public class Article { public string Id { get; set; } public string Body { get; set; } } modelBuilder.Entity<\/p>\n\n\n\n<p>() .HasFullTextSearch(a =&gt; a.Body); var results = await context.Articles .Where(a =&gt; a.Body.Search(&#8220;distributed caching performance&#8221;) &gt; 0) .OrderByDescending(a =&gt; a.Body.SearchScore()) .ToListAsync();&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Improved_LINQ_and_SQL_Translation\"><\/span><strong>3. Improved LINQ and SQL Translation<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>EF Core\u2019s LINQ translation engine is getting smarter and smarter. EF Core 10 translates more of the .NET methods and complex query structures into server-side SQL, further minimizing client-side evaluation which improves performance.<\/p>\n\n\n\n<p>Why use it<\/p>\n\n\n\n<p>&#8211; Remove unwanted fallback to the client that can destroy performance for large datasets<\/p>\n\n\n\n<p>&#8211; Build richer LINQ queries using methods like DateOnly\/TimeOnly, string.Replace, and more<\/p>\n\n\n\n<p>&#8211; Clean code, no more &#8220;raw-SQL&#8221; snippet to maintain<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_it_works-3\"><\/span><strong>How it works<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Behind the scenes, the query compiler examines expression trees and maps supported CLR methods to SQL functions or constructs. Any time a new overload of a method is recognized, EF Core will inject the corresponding SQL translation so that the database can do the heavy lifting.<\/p>\n\n\n\n<p>\/\/ Before: string.Replace fell back to client eval var updatedNames = await context.Users .Where(u =&gt; u.Email.Replace(&#8220;@old.com&#8221;, &#8220;@new.com&#8221;) == newEmail) .ToListAsync(); \/\/ Now: fully translated to SQL REPLACE(u.Email, &#8216;@old.com&#8217;,&#8217;@new.com&#8217;)&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_ExecuteUpdateAsync_Lambda_Overloads\"><\/span><strong>4. ExecuteUpdateAsync Lambda Overloads<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Bulk updates become more natural in EF Core 10 with overloaded ExecuteUpdateAsync methods that accept regular lambdas instead of expression trees. This opens the door to more dynamic update logic using local variables, methods, and inline computations.<\/p>\n\n\n\n<p>Why use this<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep update logic inline without building complex Expression&gt; trees<\/li>\n\n\n\n<li>Leverage C# methods and existing functions in your update templates<\/li>\n\n\n\n<li>Achieve set-based updates to avoid loading entities into memory<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_it_works-4\"><\/span><strong>How it works<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u00a0Pass a lambda that takes your entity and returns the updated entity instance. EF Core extracts the property assignments and converts them into a single UPDATE statement.<\/p>\n\n\n\n<p>int daysToArchive = 30; await context.Posts.ExecuteUpdateAsync(post =&gt; post.SetProperty(p =&gt; p.Status, p =&gt; p.CreatedOn &lt; DateTime.UtcNow.AddDays(-daysToArchive) ? &#8220;Archived&#8221; : p.Status) );<\/p>\n\n\n\n<p>This produces SQL like:<\/p>\n\n\n\n<p>UPDATE Posts SET Status = CASE WHEN CreatedOn &lt; DATEADD(day, -30, GETUTCDATE()) THEN &#8216;Archived&#8217; ELSE Status END&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Source-Generated_Compiled_Models\"><\/span><strong>5. Source-Generated Compiled Models<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Startup performance is important for serverless functions, microservices, and desktop applications. EF Core 10 brings you source-generated compiled models that meld your model&#8217;s metadata into generated code that skips the runtime model-building step entirely.<\/p>\n\n\n\n<p>Benefits to you<\/p>\n\n\n\n<p>&#8211; Reduce application startup time and memory usage<\/p>\n\n\n\n<p>&#8211; No more runtime reflection and expression tree generation on first use<\/p>\n\n\n\n<p>&#8211; Validation and drift detection with determinism ahead of time<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_use_it\"><\/span><strong>How to use it<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Add the Microsoft.EntityFrameworkCore.Design package and decorate your DbContext class with the [CompiledModel] attribute. At build time, the EF Core source generator creates a partial class including the fully built-in IModel now at runtime; EF Core will use the generated model instead of building one via reflection.<\/p>\n\n\n\n<p>using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; [CompiledModel] public partial class BloggingContext : DbContext { \/\/ Define DbSets&#8230; }&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_JSON_Column_Mapping\"><\/span><strong>6. JSON Column Mapping<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Relational databases are not one size fits all, and EF Core 10 embraces this idea with first-class JSON column mapping. You can store nested objects, and flexible schemes in a single JSON column while still having the capability to query deeply using LINQ.<\/p>\n\n\n\n<p>Why Use This<\/p>\n\n\n\n<p>&#8211; Simplifies data models when working with semi-stuctured or changing payloads<\/p>\n\n\n\n<p>&#8211; Eliminates costly schema migrations for trivial modifications to nested data<\/p>\n\n\n\n<p>&#8211; Provides relational integrity for core fields, with the flexibility of JSON for add-ons<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_It_Works\"><\/span><strong>How It Works<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Leverage the .HasJsonColumn() configuration on the entity\u2019s property. EF Core serializes the CLR type to JSON, when saving and deserializes it on retrieval. Once in LINQ, you are able to drill down into JSON properties utilizing the new JsonValue method, which EF Core then translates to the appropriate SQL JSON functions (i.e., JSON_VALUE on SQL Server, or -&gt;&gt; on PostgreSQL).<\/p>\n\n\n\n<p>public class Order { public int Id { get; set; } public Address ShippingAddress { get; set; } } modelBuilder.Entity() .Property(o =&gt; o.ShippingAddress) .HasJsonColumn(&#8220;ShippingDetails&#8221;); var ordersToNY = await context.Orders .Where(o =&gt; o.ShippingAddress.JsonValue(&#8220;City&#8221;) == &#8220;New York&#8221;) .ToListAsync();&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>FAQS<\/strong><\/p>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1755510866888\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Q1_What_are_the_key_performance_improvements_introduced_in_EF_Core_for_NET_2025\"><\/span>Q1 : What are the key performance improvements introduced in EF Core for .NET 2025?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>A : EF Core for .NET 2025 brings compiled models, optimized query caching, and a reduced memory footprint to speed up startup and runtime performance.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1755511019025\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Q2_How_do_compiled_models_work_and_how_can_I_enable_them_in_my_project\"><\/span>Q2 : How do compiled models work, and how can I enable them in my project?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>A : Compiled models pre-generate EF Core\u2019s metadata and mapping code at build time, eliminating runtime reflection overhead. Enable them by installing the Microsoft.EntityFrameworkCore.ModelCompilation package and configuring your DbContext options.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1755511051466\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Q3_What_enhancements_have_been_made_to_LINQ_queries_in_this_release\"><\/span>Q3 : What enhancements have been made to LINQ queries in this release?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>A : The update introduces smarter query translation and improved client-evaluation warnings. Common patterns like joins and groupings are now translated into more efficient SQL, reducing round-trips and data transfers. <\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1755511139874\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"Q4_JSON_column_mapping_with_EF_Core_for_NET_2025\"><\/span>Q4 : JSON column mapping with EF Core for .NET 2025?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>A : Yes, EF Core now offers first-class support for JSON column mapping in SQL Server and PostgreSQL. You can map nested objects directly to JSON columns using the HasJsonConversion() Fluent API.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>EF Core 10 for .NET 2025 is released. EF Core 10 represents a big step forward in terms of performance improvements, new data-modeling paradigms, and new database support for both relational and NoSQL databases. Support for named query filters, built-in full-text search for Cosmos Db, better LINQ translation, simple-to-use bulk updates, source-generated models for improved performance, and JSON column mapping lets you write cleaner code, ship faster, and handle more challenging data scenarios with confidence.&nbsp;<\/p>\n\n\n\n<p>Are you ready to get started? Download the .NET 10 SDK, install the EF Core 10 preview, and start testing these features today. As always, our final EF 10 release will be influenced by any feedback we get from the real-world apps, so your feedback will help us make EF Core even better.<\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Entity Framework Core (EF Core) continues to be the primary ORM of choice for .NET applications, and with EF Core 10 (available with .NET 10, aka .NET 2025) around the corner, you can expect many features which will enhance productivity, enable new database scenarios, and optimize performance. In a world of high-scale cloud services, modern web apps, and data-rich desktop applications, the new features will affect how you model data, optimize queries, and work across relational and NoSQL stores. In this article, we will explore the top six features shipping in EF Core 10. For each feature, we will discuss why it is important, how it works under the hood, and include some code examples to help you quickly onboard. By the end of these articles, you should have an understanding of the new features, and be ready to upgrade your projects and take advantage of everything it has to offer in EF Core 10. 1. Named Query Filters Named query filters allow you to define multiple, separate global filters on the same entity, then enable or disable them by name in specific queries. This resolves long-standing pain points around cross-cutting concerns, especially we often unit test with soft delete, multitenancy, or dynamic flags.&nbsp; Why use this&nbsp; &#8211; You can implement soft delete once without having to repeat .Where(e =&gt; !e.IsDeleted) everywhere &#8211; You can enforce tenant boundaries by default and have the choice to exclude or combine filters &#8211; You can keep filter logic uniquely named and centralized, enhancing readability. How it works You call .HasQueryFilter(name, lambda) in your OnModelCreating call. During query time, you can use the filter name in LINQ .IgnoreQueryFilters(\u2026) or selective .IgnoreQueryFilters(new[]{ &#8220;FilterA&#8221;}). EF Core formulates all the filters into the SQL WHERE clause for you, and you only exclude what you explicitly choose. modelBuilder.Entity&lt;Blog&gt;() &nbsp;&nbsp;&nbsp;&nbsp;.HasQueryFilter(&#8220;SoftDelete&#8221;, b =&gt; !b.IsDeleted) &nbsp;&nbsp;&nbsp;&nbsp;.HasQueryFilter(&#8220;Tenant&#8221;, b =&gt; b.TenantId == currentTenantId); \/\/ Later in code&#8230; var allBlogs = await context.Blogs &nbsp;&nbsp;&nbsp;&nbsp;.IgnoreQueryFilters(&#8220;SoftDelete&#8221;) &nbsp;&nbsp;&nbsp;&nbsp;.ToListAsync(); 2. Full-Text Search for Azure Cosmos DB Introducing full-text search support for Azure Cosmos DB in EF Core 10! You&#8217;re now able to specify searchable properties in your EF model, and compose rich, relevance-ranked text queries using LINQ. Why would you want to do this? &#8211; Provide fast and scalable text search over large JSON documents &#8211; Combine full-text search capabilities with Cosmos DB&#8217;s vector search for AI-based relevance &#8211; Avoid hand rolling REST calls or embedding raw SQL directly in your application&nbsp; How it works Decorate entity properties that you want indexed, then use the Search() method in LINQ. EF Core will convert your LINQ expression to what is necessary to use Cosmos DB&#8217;s search API, and you&#8217;ll get paginated results that handle filtering and ranking for you! public class Article { public string Id { get; set; } public string Body { get; set; } } modelBuilder.Entity () .HasFullTextSearch(a =&gt; a.Body); var results = await context.Articles .Where(a =&gt; a.Body.Search(&#8220;distributed caching performance&#8221;) &gt; 0) .OrderByDescending(a =&gt; a.Body.SearchScore()) .ToListAsync();&nbsp; 3. Improved LINQ and SQL Translation EF Core\u2019s LINQ translation engine is getting smarter and smarter. EF Core 10 translates more of the .NET methods and complex query structures into server-side SQL, further minimizing client-side evaluation which improves performance. Why use it &#8211; Remove unwanted fallback to the client that can destroy performance for large datasets &#8211; Build richer LINQ queries using methods like DateOnly\/TimeOnly, string.Replace, and more &#8211; Clean code, no more &#8220;raw-SQL&#8221; snippet to maintain How it works Behind the scenes, the query compiler examines expression trees and maps supported CLR methods to SQL functions or constructs. Any time a new overload of a method is recognized, EF Core will inject the corresponding SQL translation so that the database can do the heavy lifting. \/\/ Before: string.Replace fell back to client eval var updatedNames = await context.Users .Where(u =&gt; u.Email.Replace(&#8220;@old.com&#8221;, &#8220;@new.com&#8221;) == newEmail) .ToListAsync(); \/\/ Now: fully translated to SQL REPLACE(u.Email, &#8216;@old.com&#8217;,&#8217;@new.com&#8217;)&nbsp; 4. ExecuteUpdateAsync Lambda Overloads Bulk updates become more natural in EF Core 10 with overloaded ExecuteUpdateAsync methods that accept regular lambdas instead of expression trees. This opens the door to more dynamic update logic using local variables, methods, and inline computations. Why use this How it works \u00a0Pass a lambda that takes your entity and returns the updated entity instance. EF Core extracts the property assignments and converts them into a single UPDATE statement. int daysToArchive = 30; await context.Posts.ExecuteUpdateAsync(post =&gt; post.SetProperty(p =&gt; p.Status, p =&gt; p.CreatedOn &lt; DateTime.UtcNow.AddDays(-daysToArchive) ? &#8220;Archived&#8221; : p.Status) ); This produces SQL like: UPDATE Posts SET Status = CASE WHEN CreatedOn &lt; DATEADD(day, -30, GETUTCDATE()) THEN &#8216;Archived&#8217; ELSE Status END&nbsp; 5. Source-Generated Compiled Models Startup performance is important for serverless functions, microservices, and desktop applications. EF Core 10 brings you source-generated compiled models that meld your model&#8217;s metadata into generated code that skips the runtime model-building step entirely. Benefits to you &#8211; Reduce application startup time and memory usage &#8211; No more runtime reflection and expression tree generation on first use &#8211; Validation and drift detection with determinism ahead of time How to use it Add the Microsoft.EntityFrameworkCore.Design package and decorate your DbContext class with the [CompiledModel] attribute. At build time, the EF Core source generator creates a partial class including the fully built-in IModel now at runtime; EF Core will use the generated model instead of building one via reflection. using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; [CompiledModel] public partial class BloggingContext : DbContext { \/\/ Define DbSets&#8230; }&nbsp; 6. JSON Column Mapping Relational databases are not one size fits all, and EF Core 10 embraces this idea with first-class JSON column mapping. You can store nested objects, and flexible schemes in a single JSON column while still having the capability to query deeply using LINQ. Why Use This &#8211; Simplifies data models when working with semi-stuctured or changing payloads &#8211; Eliminates costly schema migrations for trivial modifications to nested data &#8211; Provides relational integrity for core fields, with the flexibility of JSON for add-ons How It Works Leverage the .HasJsonColumn() configuration on the entity\u2019s property. EF Core serializes the CLR type to JSON, when saving and deserializes it on retrieval. Once in LINQ, you are able to drill down into JSON properties utilizing the new JsonValue method, which EF Core then translates to the appropriate SQL JSON functions (i.e., JSON_VALUE on SQL Server, or -&gt;&gt; on PostgreSQL). public class Order { public int Id { get; set; } public Address ShippingAddress { get; set; } } modelBuilder.Entity() .Property(o =&gt; o.ShippingAddress) .HasJsonColumn(&#8220;ShippingDetails&#8221;); var ordersToNY = await context.Orders .Where(o =&gt; o.ShippingAddress.JsonValue(&#8220;City&#8221;) == &#8220;New York&#8221;) .ToListAsync();&nbsp; FAQS Conclusion EF Core 10 for .NET 2025 is released. EF Core 10 represents a big step forward in terms of performance improvements, new data-modeling paradigms, and new database support for both relational and NoSQL databases. Support for named query filters, built-in full-text search for Cosmos Db, better LINQ translation, simple-to-use bulk updates, source-generated models for improved performance, and JSON column mapping lets you write cleaner code, ship faster, and handle more challenging data scenarios with confidence.&nbsp; Are you ready to get started? Download the .NET 10 SDK, install the EF Core 10 preview, and start testing these features today. As always, our final EF 10 release will be influenced by any feedback we get from the real-world apps, so your feedback will help us make EF Core even better.<\/p>\n","protected":false},"author":1,"featured_media":317,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-316","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development"],"_links":{"self":[{"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/posts\/316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/comments?post=316"}],"version-history":[{"count":4,"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":344,"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/posts\/316\/revisions\/344"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/media\/317"}],"wp:attachment":[{"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/categories?post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dotnetdevelopers.us\/blogs\/wp-json\/wp\/v2\/tags?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}