It's time to add the views that will make up the user interface. Start with the view for our Index action, which displays all blogs. Then add a view for the create action, which allows the user to enter details for a new actor. Lastly, run the application to see it in action by navigating to the appropriate URL to view the data and also to create new records.
- [Instructor] We're going to go ahead and create…a couple of views, one to view the data…and the other is to create records.…So, let's start off by navigating to the Views folder,…and the thing we'll do is to create a folder called Actors.…So let's right-click, Add, and select New Folder, Actors.…And to create a view, you can right-click on Actors,…select Add, New Item, and we can choose ASP.NET,…make sure on the left-hand side that's selected,…and then you should have the option to choose MVC View Page.…
So, we'll leave the default for index, and just hit Add.…And just to have a fresh start, let's go ahead and delete…everything that's inside the index file.…And the next thing we'll do is add our director…for our model, and that'll be using IEnumerable…and entering DemoExistingDbMVC.Models.Actors.…And the next thing we want to do is just give it a simple…title in the ViewBag property of Title,…and now we'll assign it to the value of Actors.…
And then we can drop in an h2 tag called Actors,…and I will be pasting some code just to save some time,…
- Entity Framework (EF) overview
- Uses for EF
- Installing EF
- Creating entities
- Creating the DbContext
- Performing migrations
- Creating an MVC application
- Installing EF packages
- Reverse engineering the model
- Performing context and dependency injection
- Creating the controller and the view
- Using SqlServerTypeMapper
Skill Level Intermediate
Q: This course was updated on 06/23/2017. What changed?
A: The following topics were updated: using the exercise files; Mac install prerequisites; Entity Framework on Mac, part 1; and Entity Framework on Mac, part 2.