MVC中使用viewmodel
新建一个类在类中写
public class DataViewmodel { public List<users> usersmodel { get; set; } public List<luntan> luntanmodel { get; set; } public List<dongtai > dongtaimodel { get; set; } public List<production> productionmodel { get; set; } public DataViewmodel(List<Models.users> userlsit,List<luntan> luntanlist,List<dongtai> dongtailist,List<production> productionlist) { this.usersmodel = userlsit; this.luntanmodel = luntanlist; this.dongtaimodel = dongtailist; this.productionmodel = productionlist; }
控制器中以此为model写就好