Join Jess Chadwick for an in-depth discussion in this video Represent the database using Entity Framework, part of Learning ASP.NET Core MVC.
- [Narrator] Now that we've got an HTML form…that's posting validated data back to the server,…let's use the Entity Framework library…to save that data to a database.…Entity Framework is an object relational mapper…or ORM, which is really just a fancy way…of saying that it's a tool that allows you to save…and retrieve data to and from a relational database…using objects rather than hand coded sequel queries.…To start, I'll add a new class called blog data context…to our project.…
Note that the name of this class is not important at all,…you can name it any name that you like.…Then, I'll have this new class inherit…the Entity Framework base class, Db Context.…In order to tell Entity Framework…that we'll be using this class…to represent our database.…Notice how Visual Studio is highlighting…the Db Context base class to indicate…that it doesn't know what it is.…So, go ahead and add a reference to the entity…framework package to make that error go away.…
In order for the data context to actually…be useful to us, we need to define…
- Building blocks of ASP.NET Core applications
- Creating a new project
- Responding to HTTP requests
- Serving static files
- Understanding the MVC pattern
- Handling requests with controllers
- Rendering HTML with Razor
- Rendering data, view markup, and view logic
- Creating HTML forms
- Validating form data
- Reading and writing from a database with Entity Framework
- Improving the user experience
- Exposing data with a web API
- Securing your ASP.NET application
Skill Level Intermediate
1. The Basics
2. The Model-View-Controller (MVC) Pattern
Understand routing4m 24s
3. Render HTML with Views
4. Work with Data
5. Improve User Experience with Ajax and Web APIs
6. Secure Your Application
Next steps1m 42s
- 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.