What is Entity Framework. 9
Why Entity Framework. 11
Relational Model and Object Model 12
Entity Framework Architecture. 17
Entity Framework Approaches. 21
Model First. 23
Database First. 23
Code First. 24
Entity Framework Approaches in Action. 25
Model First. 25
Database First. 59
Code First. 73
Code First Options. 93
CreateDatabaseIfNotExists. 93
DropCreateDatabaseWhenModelChanges. 93
DropCreateDatabaseAlways. 93
Code First Migrations. 95
Code First Migrations in Action. 95
MigrationHistory Table. 112
Querying in Entity Framework. 114
LINQ to SQL. 114
Entity SQL. 114
Native SQL. 115
Loadings in Entity Framework. 116
Lazy Loading. 116
Eager Loading. 118
Explicit Loading. 118
Code First Migrations in ASP.NET Web API 2.0. 120
Web API 120
Creating a Web API Project. 120
Creating the model 124
Adding the API Controller. 128
Entity Framework Code First Migrations. 138
Exploring the Generated Database. 149
Running the application and Setup Postman. 153
Endpoints and Database operations. 157
GET. 158
POST. 161
PUT. 165
DELETE. 169
Entity Framework Core. 172
Where can EF Core be Used. 173
Code First Approach using Entity Framework Core. 174
Adding Entities. 174
Data Annotations. 177
Adding DB Context. 183
Code First Migrations in EF Core. 195
Seeding the Database. 211
EF Core Summary. 217
Conclusion. 218
References. 220
Index. 221