Contents tagged with Entity Framework Code First
-
Succinctly Books Index
This page lists all the books I wrote or reviewed for Syncfusion’s Succinctly series.
-
Implementing Missing Features in Entity Framework Core – Part 7: Entity Configuration in Mapping Classes
This is the seventh post in a series of posts about bringing the features that were present in Entity Framework pre-Core into EF Core. The others are:
Part 1: Introduction, Find, Getting an Entity’s Id Programmatically, Reload, Local, Evict
-
Entity Framework Pitfalls: Skip/Take Position Matters
In LINQ, you normally do paging through the Skip and Take operators. These are the LINQ counterparts to whatever the relational database uses for pagination – ROW_NUMBER(), LIMIT…OFFSET, TOP, ROWNUM, etc.
-
Entity Framework Pitfalls: Null Semantics
Imagine you have a simple class:
-
Entity Framework Pitfalls: Queries Over Navigation Properties When There Are Foreign Key Properties Are Ignored
Long title, I know!
-
Missing Features in Entity Framework Core
Updated: see my post here for info on EF Core 8.
-
Entity Framework Pitfalls: Migrations and DbContext Construction
If you want to create or apply a migration over a DbContext-derived context and your context doesn’t have a public parameterless constructor, it will fail. This happens with both .NET Framework and .NET Core: the problem is that the migrations framework has no way of knowing how to create the context so as to get information from it, the migrations framework actually instantiates it!
-
Entity Framework Pitfalls: Entity Refresh
After an entity is loaded by Entity Framework, it gets stored in its first level cache. After that, whenever EF executes a query that returns this entity, identified by its primary key, EF always returns the cached entry, and makes no attempt to see if the cached data (the rest of the properties) is still up to date with that returned from the query. This feature is common to other ORMs, but it may result in unexpected behavior – we cannot rely on the state of a loaded entity if the database can change by other processes..
-
Implementing Missing Features in Entity Framework Core – Part 2: Explicit Loading
Update: this is now implemented in Entity Framework Core 1.1: https://github.com/aspnet/EntityFramework/releases/tag/rel%2F1.1.0.
-
Entity Framework Pitfalls: Attaching New Entities With Existing Related Ones
One of the patterns in EF 6.x for attaching new entities to a context is to simply change it’s state to Added: