我正在使用 RTM 版本的 Windows 8 和 VS 2012 Ultimate。我有一个使用 SqlCe 4.0 和代码优先实体框架模型的 MVC4 项目。
模型很简单:
public class MyThing
{
public int MyThingId { get; set; }
public int UserId { get; set; }
public string Title { get; set; }
public string Address { get; set; }
public string Description { get; set; }
public DateTime Date { get; set; }
}
当我尝试使用内置脚手架创建新控制器时,我收到以下错误:
“无法检索 MyThing 的元数据”
“不支持使用相同的 DbCompiledModel 针对不同类型的数据库服务器创建上下文。相反,为正在使用的每种类型的服务器创建单独的 DbCompiledModel。
如何让脚手架工作?