I have a controller that returns a list of view models, like so:
public ActionResult Index()
{
List<DailyPlanListViewModel> viewModels = new List<DailyPlanListViewModel>();
//do some stuff with the list
return View(viewModels);
}
and a view that takes the list and should display the information
@model List<IEnumerable<D2D.Web.ViewModels.DailyPlan.DailyPlanListViewModel>>
BUT I get this error, because of the IEnumerable type:
The model item passed into the dictionary is of type 'System.Collections.Generic.List1[D2D.Web.ViewModels.DailyPlan.DailyPlanListViewModel]', but this dictionary requires a model item of type 'System.Collections.Generic.List1[System.Collections.Generic.IEnumerable`1[D2D.Web.ViewModels.DailyPlan.DailyPlanListViewModel]]'.
I can't get it to work. What can I do?
@model IEnumerable<D2D.Web.ViewModels.DailyPlan.DailyPlanListViewModel>@model List<D2D.Web.ViewModels.DailyPlan.DailyPlanListViewModel>@model List<D2D.Web.ViewModels.DailyPlan.DailyPlanListViewModelList<IEnumerable<...>>should be quite obvious what the error is getting at.