public IActionResult Index() { List <Actor> actors = new List <Actor> { new Actor { Firstname = "Meryl", Lastname = "Streep", Films = 20 }, new Actor { Firstname = "Bobcat", Lastname = "Goldthwaite", Films = 2 }, new Actor { Firstname = "Steve", Lastname = "Guttenberg", Films = 5 } }; var vm = new ActorListViewModel { Actors = actors }; ViewData["actors"] = actors; // return View(vm); return(View()); }
public ActorList() { //Setting BindingContext ViewModel = new ActorListViewModel(); InitializeComponent(); }