Join Michael Sullivan for an in-depth discussion in this video Code-first development with the Entity Framework, part of Learning ASP.NET.
…Now, take a look at how we can automatically generate a…database with tables, using a simple C# class in Entity Framework.…Because we've already defined a class for…the information we want to store, we can use…what's known as the first code approach, to…create the database based on the existing class.…The first thing we need to create.…Is a class that inherits from DbContext.…That's going to expose entities in the database…using public properties of a type called DbSet.…
So I'm going to continue where we last left off…with our explore California MVC application, in the Exercise Files.…Chapter 3, ExploreCalifornia, and open the ExploreCalifornia solution.…Next, I'm going to add a class to the Models folder.…So go to Add > New Item, and then under Code on the…left I'm just going to choose an empty C# class and call it MyDBContext.…First, we are going to inherit from the DbContext class.…And I don't have a reference to that.…
I showed you right-click resolve before.…You can do also, Ctrl +.…Or Ctrl +.…And quickly add that using statement.…
- Exploring .NET in general and ASP.NET in particular
- Creating controllers and views
- Working with models and forms
- Managing data
- Creating web APIs
- Establishing connections with SignalR
Skill Level Beginner
ASP.NET MVC 4 Essential Trainingwith Jess Chadwick3h 56m Intermediate
1. Exploring the Framework and the Development Environment
2. Structuring Applications
3. Working with Data
Using LINQ to Entities6m 12s
4. Web API and RESTful Services
5. Real-Time Web with SignalR
6. Hands-On Practice
Next steps2m 3s
- 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.