working-with-real-data-using-entity-framework-core-slides
working-with-real-data-using-entity-framework-core-slides
Gill Cleeren
CTO XPIRIT BELGIUM
@gillcleeren www.snowball.be
Overview Hello EF Core
Adding EF Core to the application
Initializing the database
Modifying the model
Hello EF Core
Entity Framework Core (EF Core)
Lightweight &
ORM LINQ support
Cross-platform
Entity Framework
Code Database
What EF Core Does for You
Class Table
{
"ConnectionStrings": {
"DefaultConnection":
"Server=(localdb)\\mssqllocaldb;
Database=BethanysPieShop;
Trusted_Connection=True;
MultipleActiveResultSets=true“
}
}
Startup Changes
_appDbContext.Orders.Add(order);
_appDbContext.SaveChanges();
Demo
Create database
Database migration
Database
Package Manager Console
Commands
>add-migration <MigrationName>
>update-database
Initializing the Database
Initial data
Update database