CDCoding Dropletsincodingdroplets.com·7h ago · 12 min readUnable to Create an Object of Type DbContext in EF Core: Causes and FixesYou add an entity, run dotnet ef migrations add AddOrders, and the tooling stops dead: Unable to create an object of type 'AppDbContext'. For the different patterns supported at design time, see https10
EAEugene Atinbireinayinenongre.hashnode.dev·6d ago · 4 min readHow I Reduced Build Time from Over 5 Minutes to Under 30 Seconds by Consolidating 400+ Entity Framework MigrationsAs developers, we often focus on optimizing application performance for our users, but we sometimes overlook something just as important our own developer experience. In our case, one of the biggest p00
Qqodorsinqodors.hashnode.dev·Jul 25 · 5 min readThe N+1 Query Problem in EF Core (And How to Spot It Before Production Does)A page that felt fine in testing is slow in production. Same code, same query, but now it crawls. You open the SQL log and there it is — not one query, but two hundred. One to load the list, then one 00
Qqodorsinqodors.hashnode.dev·Jul 22 · 6 min readEF Core Is Already a Repository. Stop Wrapping It in Another One.Open a lot of .NET projects and you'll find the repository pattern sitting on top of Entity Framework Core. IProductRepository, GetById, Add, Save, the whole set. Underneath, every method just calls t00
Qqodorsinqodors.hashnode.dev·Jul 10 · 5 min readAsNoTracking: The EF Core Setting Your Read Queries Are MissingMost of the queries in a typical app are reads. You fetch data, show it, and never change it. EF Core doesn't know that. By default it assumes every entity you load might be modified and saved back, s00
Qqodorsinqodors.hashnode.dev·Jul 9 · 6 min readIQueryable vs IEnumerable: The Mistake That Loads Your Whole TableYou wrote a clean LINQ query. It filters down to ten rows. It runs fine in dev, and then in production it's slow and your database CPU is higher than it should be for such a small result. The query lo00
CDCoding Dropletsincodingdroplets.com·Jul 3 · 10 min readMigrating from EF Core 8 to EF Core 10 in ASP.NET Core: A Step-by-Step GuideMost teams I work with stayed on EF Core 8 because it was the LTS release, and now they are looking at EF Core 10, the next LTS, and want to skip 9 entirely. That instinct is right, but it hides a tra00
CDCoding Dropletsincodingdroplets.com·Jun 30 · 9 min readThe Entity Instance Cannot Be Tracked in ASP.NET Core: Causes and FixesIf you have hit System.InvalidOperationException: The instance of entity type 'X' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked, you are lookin00
Qqodorsinqodors.hashnode.dev·Jun 20 · 6 min readEntity Framework Is Slow. It's Not EF's Fault.Entity Framework Is Slow. It's Not EF's Fault. Your API was quick in development. Then traffic picks up and a few endpoints start taking three seconds to respond. You open the code, see Entity Framewo00
CDCoding Dropletsincodingdroplets.com·Jun 15 · 10 min readEF Core Returns Stale Data After Update in Production: Root Cause and FixYou update an order status from Pending to Confirmed, call SaveChangesAsync, and get a clean 200 response. The next GET request on that order comes back Pending. You check the database directly — the 00