Within Razor is it possible for me to add another model, I currently have
@model Models.ListModel
I would like to add another model into the razor view e.g.
@model2 Model.PostModel
Within Razor is it possible for me to add another model, I currently have
@model Models.ListModel
I would like to add another model into the razor view e.g.
@model2 Model.PostModel
Create a ViewModel with both the classes inside it Example:
public class PostListViewModel
{
public List ListModel{ get; set; }
public Post PostModel{ get; set; }
}