Entity Framework Core provides full transaction support, both implicitly and explicitly. EF Core also supports transaction sharing between DbContext instances. Phil covers this information and then demonstrates implicit and explicit transactions, as well as transaction sharing.
- [Instructor] EF Core has…very strong transactional support.…SaveChanges wraps all operations…tracked by the DB change tracker…in an implicit transaction.…You can also use an explicit transaction…and you can share transactions across DbContexts…by sharing the DbConnection and DbTransaction.…The first task will show…that EF indeed wraps SaveChanges…into an implicit transaction…and rolls back all changes if any of the changes fail.…
So, to arrange this test…we're going to start with a counter…and this will be the number of products…that we have in the database.…We're going to create two products.…The first one we're going to use the TestHelper…and this sets up all of the required fields for us…and this second one we're going to create…just by doing new_Product…and we're going to have it doubly fail…because we are not setting up the required field.…
We're also assigning it the primary key.…There is a way with Entity Framework Core…to mainly assign the primary key,…we'll cover that later,…but right now without identity insert turned on…
- 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.