【发布时间】:2016-11-28 14:01:29
【问题描述】:
我的模型文件夹中有两个模型,称为模型,我正在尝试从模型中提取数据以将其显示在视图中,我知道只有一个模型语句可以应用于视图。所以我创建了一个 ViewModels,其中包含我想在视图中引用的属性。现在,当我运行应用程序时,我得到一个编译错误,上面写着:
“编译器错误消息:CS0246:找不到类型或命名空间名称“模型”(您是否缺少 using 指令或程序集引用?)”
查看模型代码
public class MainModelscs <T> where T :class
{
public StoreAudit StoreAudit { get; set; }
public StoreQuestions StoreQuestions { get; set; }
public IPagedList<T> IndexList { get; set; }
}
视图中的模型属性
@model PopMarketing.ViewModel.MainModelscs<Models>
【问题讨论】: