In this section, Phil walks through the Entity Framework Core files—AdventureWorksContext and the Entities—that were created as a result of scaffolding the existing AdventureWorks database.
- [Instructor] Scaffolding the DbContext and the POCOs…resulted in two main sets of files.…First and foremost, the AdventureWorksContext,…which is derived from a DbContext,…and this contains a DbSet for each entity.…It also contains an OnConfiguring method…and this is how, in the scaffolding scenario,…the DbContext is configured to use SQL Server…and the correct connection string.…And then there's an OnModelCreating method…and this provides additional configuration…for the entities themselves.…
And when we look at the entities,…which we'll do here shortly,…they are just POCO classes…and they're configured to map to the database…through some conventions, data annotations,…and the fluent API…in the OnModelCreating method of the DbContext.…And the example of a convention is a primary key.…So if you have a property,…which is the entity name ID, such as product ID,…and it's an integer or a GUID,…then it will automatically become the primary key.…
There are also navigation properties…and this representative of foreign keys in a database.…
- Entity Framework Core components and projects
- Working with scaffolded files
- Testing with xUnit
- Viewing generated SQL
- Composing queries
- Sorting and filtering results
- Working with aggregates
- Loading related data
- Logging and tracking
- Mapping functions
- Generics and delegates
- Checking concurrency
- Resiliency and transactions
Skill Level Intermediate
Learning Entity Framework Corewith Reynald Adolphe1h 35m Intermediate
1. Get to Know Entity Framework
2. Set the Stage
3. Querying Data: Part 1
4. Querying Data: Part 2
5. Advanced Query Features
6. Persisting Data
7. DbContext Options and Configuration
Thank you1m 23s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.