I'm getting the following error when rendering a partial view and I'm not sure why as I'm passing through the pagination property as my model.
The model item passed into the dictionary is of type 'StockManager.ViewModels.StockManagementViewModel', but this dictionary requires a model item of type 'StockManager.ViewModels.Shared.PaginationViewModel'.
Here's the model...
public class StockManagementViewModel : ViewModelBase
{
public List<StockReportParentRowsViewModel> StockLevels { get; set; } = new List<StockReportParentRowsViewModel>();
public PaginationViewModel StockLevelsPagination { get; set; }
public Dictionary<Int32, String> Full_Site_List { get; set; } = HelperMethods.GenericHelpers.GetFullSiteList();
}
And here is where I pass PaginationViewModel
instance into the partial view:
@{ Html.RenderPartial("~/Views/Shared/_PaginationPartial.cshtml", Model.StockLevelsPagination); }
Finally, here's the view model reference for the pagination view.
@model StockManager.ViewModels.Shared.PaginationViewModel
StockManagementViewModel.StockLevelsPagination
is definitely an instance of StockManager.ViewModels.Shared.PaginationViewModel
so what gives? What have I missed?