From the course: Learning Entity Framework Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create the view

Create the view - Entity Framework Tutorial

From the course: Learning Entity Framework Core

Start my 1-month free trial

Create the view

- [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…

Contents