public class ViewModels
{
public List<Plan> pl { get; set; }
public List<Week> wk { get; set; }
} viewmodel 类
还要 加什么代码?
controller 里面 那个 XXXXContext 不知道是哪里的
public class ViewModels
{
public List<Plan> pl { get; set; }
public List<Week> wk { get; set; }
} viewmodel 类
还要 加什么代码?
controller 里面 那个 XXXXContext 不知道是哪里的
这样就可以了。 XXXXContext 应该是linq to sql或者ef的上下文类,用来访问数据库的。和viewmodel无关。