I am trying to follow this example: Creating Model Classes with the Entity Framework (C#)
.
I am getting an error when I try to this:
ViewData.Model = _db.MovieSet.ToList();
In my intellisense, I do not get the ToList()
Here is the code:
using System.Linq;
using System.Web.Mvc;
using MovieEntityApp.Models;
namespace MovieEntityApp.Controllers
{
[HandleError]
public class HomeController : Controller
{
MoviesDBEntities _db;
public HomeController()
{
_db = new MoviesDBEntities();
}
public ActionResult Index()
{
ViewData.Model = _db.MovieSet.ToList();
return View();
}
}
}
I am trying to display the results in the a Repeater on the View, can anyone help with what the code would look like in the code behind as well as the ASPX page.