{"id":595868,"date":"2025-09-02T12:39:28","date_gmt":"2025-09-02T11:39:28","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=dotnet&#038;p=595868"},"modified":"2025-09-02T13:45:36","modified_gmt":"2025-09-02T12:45:36","slug":"dotinsights-september-2025","status":"publish","type":"dotnet","link":"https:\/\/blog.jetbrains.com\/en\/dotnet\/2025\/09\/02\/dotinsights-september-2025","title":{"rendered":"dotInsights | September 2025"},"content":{"rendered":"\n<p><strong>Did you know?<\/strong> The C# language has a <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/language-reference\/statements\/jump-statements\" target=\"_blank\" rel=\"noopener\">GOTO statement<\/a>? It sure does. This is a case of \u201cjust because you could doesn\u2019t mean you should\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"2560\" height=\"1440\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2025\/09\/DN-social-BlogFeatured-1280x720-2x.png\" alt=\"dotInsights | September 2025\" class=\"wp-image-596078\"\/><\/figure>\n\n\n\n<p>Welcome to dotInsights by JetBrains! This newsletter is the home for recent .NET and software development related information.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">? Featured Content<\/h2>\n\n\n\n<p><em><strong>This month\u2019s featured content is from Chris Woodruff!<\/strong> Chris has been at the forefront of software development since before the first .COM boom, building a career that spans enterprise web development, cloud solutions, software analytics, and developer relations. As an Architect, he applies his deep technical expertise to tackle complex challenges, with a particular focus on API design and scalable architectures. He is recognized as a Microsoft MVP specializing in .NET and Web Development. Woody\u2019s impact extends beyond his professional responsibilities; he is a dedicated mentor and educator, teaching courses that help individuals transition into tech careers. His passion for sharing knowledge has made him a sought-after speaker at international conferences, where he discusses topics such as database development, web APIs, and software architecture. He contributes to the developer community by co-hosting <a href=\"https:\/\/www.breakpoint.show\/\" target=\"_blank\" rel=\"noopener\">The Breakpoint Show<\/a> podcast and creating content that aids engineers in refining their skills.<\/em><\/p>\n\n\n\n<p><strong>Entity Framework Core (EF Core)<\/strong> has emerged as the preferred Object-Relational Mapping (ORM) tool for modern .NET developers. However, effectively utilizing it requires more than just familiarity with methods like <code>.Add()<\/code> and <code>.SaveChanges()<\/code>. This concise newsletter summarizes the essential insights from a full-day EF Core workshop (contact Woody for details below if interested), equipping you with the knowledge necessary to build fast, secure, and scalable data access layers.<\/p>\n\n\n\n<p><strong>Getting Started with EF Core<\/strong><br>EF Core is a lightweight, extensible, and high-performance data access&nbsp;framework. It supports a clean code-first approach while allowing database-first flexibility when needed.<\/p>\n\n\n\n<p>Key Concepts:<br>\u2705 DbContext is your gateway to the database. It manages connections&nbsp;change tracking, and query execution.<br>\u2705 Use DbSet&lt;T&gt; to represent your entity collections.<br>\u2705 Code-First is ideal for domain-driven development; use Fluent API to fine-tune schema mappings.<br>?Pro Tip: Always register your DbContext as Scoped. Avoid Singleton lifetimes to&nbsp;prevent memory issues and concurrency errors.<\/p>\n\n\n\n<p><strong>Modeling Relationships Like a Pro<\/strong><br>EF Core handles common relationship types easily, but it\u2019s up to you to&nbsp;configure them correctly.<\/p>\n\n\n\n<p>Modeling Must-Knows:<br>\u2705 Define one-to-many with .HasMany().WithOne()<br>\u2705 Use explicit foreign keys in your model for clarity.<br>\u2705 Prefer eager loading (.Include()) for web APIs to avoid runtime surprises.<br>?Pro Tip: Don\u2019t rely on lazy loading in APIs. It hides performance issues and can cause excessive database queries.<\/p>\n\n\n\n<p><strong>Querying with Power and Precision<\/strong><br>LINQ is a powerful abstraction, but be intentional.<\/p>\n\n\n\n<p>Performance-First Query Tips:<br>\u2705 Use .Select() to shape the result into DTOs, avoid sending entire entities.<br>\u2705 Apply .AsNoTracking() for read-only queries to reduce memory use.<br>\u2705 Chain .Where() and .OrderBy() before projection to reduce query size.<br>?Pro Tip: Avoid over-fetching by skipping unnecessary .Include() chains. Smaller&nbsp;queries are faster queries.<\/p>\n\n\n\n<p><strong>SQL Server: Tune What EF Core Generates<\/strong><br>You\u2019re still writing SQL, it\u2019s just hidden behind LINQ.<\/p>\n\n\n\n<p>SQL Server Optimization: <br>\u2705 Use SSMS to inspect EF-generated SQL.<br>\u2705 Read execution plans to diagnose slow queries.<br>\u2705 Tune indexes based on frequent query filters or sorts.<br>\u2705 Leverage Query Store to monitor historical query behavior<br>?Pro Tip: Computed columns and filtered indexes can supercharge performance when&nbsp;used intentionally.<\/p>\n\n\n\n<p><strong>Secure Your Data Layer<\/strong><br>EF Core doesn&#8217;t protect you from bad design. Data security must be&nbsp;implemented in your access layer.<\/p>\n\n\n\n<p>Security Strategies:<br>\u2705 Use DTOs to prevent overposting.<br>\u2705 Filter by user role or claim inside the query, not afterward.<br>\u2705 Never interpolate raw SQL, always parameterize inputs.<br>\u2705 Store secrets securely: Use User Secrets in dev, Managed Identity in&nbsp;Azure.<br>?Pro Tip: Your DbContext is an attack surface. Secure it like you would any API.<\/p>\n\n\n\n<p><strong>Testing EF Core with Confidence<\/strong><br>Testing EF Core doesn\u2019t have to be painful, use the right tools.<\/p>\n\n\n\n<p>Approach by Test Type:<br>\u2705 Use In-Memory provider for fast unit tests, but be aware it behaves&nbsp;differently from SQL Server.<br>\u2705 Prefer SQLite in-memory for a closer match to production.<br>\u2705 Use Testcontainers or local SQL Server for full integration testing.<br>?Pro Tip: Seed data should be scenario-specific and reset between tests. Use Respawn or EF-based seeding for consistency.<\/p>\n\n\n\n<p><strong>Scaling for the Cloud<\/strong><br>Cloud-readiness means EF Core must handle concurrency, resiliency, and&nbsp;high throughput.<\/p>\n\n\n\n<p>Cloud-Ready Practices:<br>\u2705 Use DbContextPool for high-performance APIs.<br>\u2705 Configure retry logic with EnableRetryOnFailure(), and even better, learn&nbsp;and use Polly, which is a library for .NET designed for resilience and&nbsp;transient-fault handling. It enables developers to express policies such as&nbsp;Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent, thread-safe manner.<br>\u2705 Apply distributed caching at the service layer, not the EF level.<br>\u2705 Use sharded\/multi-tenant strategies carefully: filtered queries, schema&nbsp;separation, or even DB-per-tenant.<br>?Pro Tip: Azure SQL + EF Core is a battle-tested combo, just don\u2019t forget to tune your&nbsp;retry strategies and monitor connection health.<\/p>\n\n\n\n<p><strong>Common Pitfalls and How to Avoid Them<\/strong><br>Even experienced developers can fall into subtle traps when working&nbsp;with EF Core. Here are some of the most common mistakes, and how&nbsp;to dodge them in your projects.<\/p>\n\n\n\n<p>\u274c Lazy Loading in APIs<br>Lazy loading can cause unexpected multiple queries per request. In&nbsp;web APIs, it often results in the dreaded N+1 problem.<br>\u2705 Use Eager Loading or Projections<br>Explicitly load related data with .Include() or shape the query using .Select() and DTOs.<\/p>\n\n\n\n<p>\u274c Leaking Entities to the Client<br>Exposing EF entities directly in your controllers or UI tightly couples&nbsp;your domain to your database schema.<br>\u2705 Use DTOs or ViewModels<br>Map to dedicated types that represent what the consumer needs.&nbsp;Nothing more, nothing less.<\/p>\n\n\n\n<p>\u274c Overusing .Include() Chains<br>Deep includes may look convenient, but can result in massive SQL&nbsp;joins and redundant data loading.<br>\u2705 Load Only What You Need<br>Be intentional. Use shaped queries and projections for complex object&nbsp;graphs.<\/p>\n\n\n\n<p>\u274c Ignoring Execution Plans and SQL Output<br>If you\u2019re not inspecting the SQL your LINQ generates, you\u2019re flying&nbsp;blind.<br>\u2705 Use SSMS and Query Store<br>Always review generated SQL for critical paths. Use SQL Server&nbsp;tooling to optimize indexes and execution plans.<\/p>\n\n\n\n<p><strong>Ready to Go Deeper?<\/strong><\/p>\n\n\n\n<p>? <a href=\"https:\/\/github.com\/cwoodruff\/EFCoreDemos\" target=\"_blank\" rel=\"noopener\">Explore Chris&#8217;s GitHub repo with all of his EF Core demos<\/a>. <\/p>\n\n\n\n<p>?\ufe0f Need help applying this in production or want to discuss the workshop?&nbsp;<a href=\"https:\/\/www.woodruff.dev\/contact\/\" target=\"_blank\" rel=\"noopener\">Book some time or have a code review with Chris<\/a>. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">? Links<\/h2>\n\n\n\n<p>Here\u2019s the latest from the developer community.<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=u-oRiXDKIrE&amp;ab_channel=EmilyBache\" target=\"_blank\" rel=\"noopener\">Technical Coaching: From One Team to Many Teams<\/a> ? &#8211; Emily Bache<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=g5-9fB8UuvE&amp;ab_channel=GuiFerreira\" target=\"_blank\" rel=\"noopener\">Why Most .NET Developers Don&#8217;t Need MediatR<\/a> ? &#8211; Gui Ferreira<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=ipoGe2IJtJg&amp;ab_channel=FlashOWare\" target=\"_blank\" rel=\"noopener\">2code ^ !2code [S2025E11] Multi-targeting Roslyn Components &#8211; Part 1<\/a> ? &#8211; FlashOWare by Eva Ditzelm\u00fcller &amp; Stefan P\u00f6lz<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=q7BoBlQffZE&amp;ab_channel=CodeOpinion\" target=\"_blank\" rel=\"noopener\">The #1 Reason Your Software System Gets Messy<\/a> ? &#8211; CodeOpinion by Derek Comartin&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=jhriGGuaW4w&amp;ab_channel=TechnologyandFriends\" target=\"_blank\" rel=\"noopener\">Steve Smith on How Generative AI is the New Offshoring<\/a> ?- Technology and Friends by David Giard<\/li>\n\n\n\n<li><a href=\"https:\/\/creators.spotify.com\/pod\/profile\/productivecsharp\/episodes\/Stop-Wasting-Time-Use-the-702010-Rule-to-Grow-Fast-as-a-Developer-e36gqlb\" target=\"_blank\" rel=\"noopener\">Stop Wasting Time: Use the 70\/20\/10 Rule to grow as a developer<\/a> ?\ufe0f &#8211; Andrea Angella<\/li>\n\n\n\n<li><a href=\"https:\/\/andrewlock.net\/converting-an-xunit-project-to-tunit\/\" target=\"_blank\" rel=\"noopener\">Converting an xUnit test project to TUnit<\/a> &#8211; Andrew Lock<\/li>\n\n\n\n<li><a href=\"https:\/\/nestenius.se\/net\/implementing-bff-pattern-in-asp-net-core-for-spas\/\" target=\"_blank\" rel=\"noopener\">Implementing BFF Pattern in ASP.NET Core for SPAs<\/a> and <a href=\"https:\/\/nestenius.se\/net\/bff-in-asp-net-core-7-introducing-the-duende-bff-library\/\" target=\"_blank\" rel=\"noopener\">BFF in ASP.NET Core #7 \u2013 Introducing the Duende BFF Library<\/a> &#8211; Tore Nestenius<\/li>\n\n\n\n<li><a href=\"https:\/\/www.codemag.com\/article\/2505031\" target=\"_blank\" rel=\"noopener\">Exploring .NET MAUI: Popups, Messages, and Data Validation<\/a> &#8211; Paul Sheriff<\/li>\n\n\n\n<li><a href=\"https:\/\/blog.elmah.io\/mastering-incremental-source-generators-in-csharp-a-complete-guide-with-example\/\" target=\"_blank\" rel=\"noopener\">Mastering Incremental Source Generators in C#: A Complete Guide with Example<\/a> &#8211; Ali Hamza Ansari<\/li>\n\n\n\n<li><a href=\"https:\/\/www.textcontrol.com\/blog\/2025\/08\/27\/creating-trusted-document-containers-with-pdf-a-3b-in-dotnet-csharp\/\" target=\"_blank\" rel=\"noopener\">Creating Trusted Document Containers with PDF\/A-3b in .NET C#<\/a> &#8211; Bjoern Meyer<\/li>\n\n\n\n<li><a href=\"https:\/\/blog.elmah.io\/penhow-i-reduced-api-response-time-by-70-in-a-large-net-project\/\" target=\"_blank\" rel=\"noopener\">How I Reduced API Response Time by 70% in a Large .NET Project<\/a> &#8211; Ali Hamza Ansari<\/li>\n\n\n\n<li><a href=\"https:\/\/medium.com\/@denmaklucky\/entity-framework-or-dapper-which-one-is-better-for-net-c-8500ef22b50a\" target=\"_blank\" rel=\"noopener\">Entity Framework or Dapper: which one is better for .NET\/C#?<\/a> &#8211; Denis Makarenko<\/li>\n\n\n\n<li><a href=\"https:\/\/duendesoftware.com\/blog\/20250825-optimizing-aspnet-core-web-site-performance\" target=\"_blank\" rel=\"noopener\">Optimizing ASP.NET Core Web Site Performance &#8211; Duende&#8217;s Need for Speed<\/a> &#8211; Khalid Abuhakmeh<\/li>\n\n\n\n<li><a href=\"https:\/\/www.syncfusion.com\/blogs\/post\/solid-principles-ai-development\" target=\"_blank\" rel=\"noopener\">How to Apply SOLID Principles in AI Development Using Prompt Engineering<\/a> &#8211; Jeyasri Murugan<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">? From our .NET Guide<\/h2>\n\n\n\n<p>Each month we feature tutorials or tips from our <a href=\"https:\/\/www.jetbrains.com\/guide\/dotnet\" target=\"_blank\" rel=\"noopener\">.NET Guide<\/a>.<\/p>\n\n\n            <div class=\"newsletter\">\n                                                            <article class=\"newsletter__post\">\n                                                                                    <img decoding=\"async\" class=\"newsletter__post-img\" src=\"https:\/\/www.jetbrains.com\/guide\/assets\/thumbnail-77a2f464.png\" alt=\"Azure Functions\">\n                                                                            <div class=\"newsletter__post-text\">\n                                                            <h3>Azure Functions<\/h3>\n                                                        <p>Developing and managing cloud solutions often requires a seamless and efficient workflow. Rider, with its robust integration and tooling, empowers developers to build, debug, and deploy Azure Functions effortlessly. Whether you&#8217;re handling event-driven serverless functions or scaling cloud-native applications, Rider offers the tools to identify issues early, ensure smooth debugging, and optimize your deployment process.<\/p>\n<p>by Matthias Koch<\/p>\n                                                            <a href=\"https:\/\/www.jetbrains.com\/guide\/dotnet\/tutorials\/azure-functions\/\" class=\"btn\" target=\"_blank\" rel=\"noopener\">See More<\/a>\n                                                    <\/div>\n                    <\/article>\n                                    <\/div>\n    \n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u2615 Coffee Break<\/h2>\n\n\n\n<p>Take a break to catch some fun social posts.<\/p>\n\n\n\n<p>True story\u2026<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-9-16 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How programming actually works.\" width=\"422\" height=\"750\" src=\"https:\/\/www.youtube.com\/embed\/bBkuARBtCbE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Fridays feel like\u2026<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-9-16 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"#developermemes #tech#codingmemes #programmerhumor #funny #developer #coding #comedy #programming\" width=\"422\" height=\"750\" src=\"https:\/\/www.youtube.com\/embed\/n98D5CWyV5M?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">?\ufe0f JetBrains News<\/h2>\n\n\n\n<p>What\u2019s going on at JetBrains? Check it out here:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2025\/08\/28\/resharper-s-new-out-of-process-engine-cuts-ui-freezes-in-visual-studio-by-80\/\">ReSharper\u2019s New Out-of-Process Engine Cuts Visual Studio start-up UI freezes by 61%<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2025\/08\/14\/resharper-performance-improvements-2025\/\">Next-Level Performance Improvements in ReSharper 2025.2<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2025\/08\/14\/resharper-and-the-net-tools-2025-2-are-out\/\">ReSharper and the .NET Tools 2025.2 Are Out!<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2025\/08\/14\/rider-2025-2-is-here-with-junie-in-ide-opentelemetry-game-dev-upgrades-and-more\/\">Rider 2025.2 Is Here with Junie, In-IDE OpenTelemetry, Game Dev Upgrades, and More<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-align-center\">\u2709\ufe0f Comments? Questions? Send us an&nbsp; <a href=\"mailto:dotnet-advocates@jetbrains.com\">email<\/a>.&nbsp;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p align=\"center\"><a class=\"jb-download-button\" href=\"https:\/\/www.jetbrains.com\/lp\/dotinsights-monthly\/\" target=\"_blank\" rel=\"noopener\">Subscribe to dotInsights<\/a><\/p>\n","protected":false},"author":901,"featured_media":596078,"comment_status":"closed","ping_status":"closed","template":"","categories":[4992],"tags":[8363],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/dotnet\/595868"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/dotnet"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/types\/dotnet"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/users\/901"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/comments?post=595868"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/dotnet\/595868\/revisions"}],"predecessor-version":[{"id":596283,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/dotnet\/595868\/revisions\/596283"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/media\/596078"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/media?parent=595868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/categories?post=595868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/tags?post=595868"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/en\/wp-json\/wp\/v2\/cross-post-tag?post=595868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}