I want to create a details page about a movie, but I´m getting this error and I´m kinda stuck. I\'m getting a cant convert type error. I do understand the error, but I dont
You should map your DB (MoviesData
) model To Bussiness model (MovieViewModel
)
public ActionResult Details(int Id = 1)
{
MoviesData movie = db.MoviesData.Find(Id);
MovieViewModel MovieVM = new MovieViewModel();
MovieVM.MovieID = movie.MovieID;
MovieVM.MovieName = movie.MovieName;
MovieVM.MovieDescription = movie.MovieDescription;
MovieVM.MovieCategory = movie.MovieCategory;
MovieVM.MovieYear = movie.MovieYear;
return View(MovieVM);
}