为什么不能从DbContext类派生? [英] Why Not able to derive from DbContext Class?
问题描述
你好
我正在尝试在链接 [
请让我知道解决该问题需要做些什么.请参考上面提供的链接以查看源代码.
关于
Hello
I am trying out the sample MVC application which is been posted in the link "http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part4-cs"[^]... As mentioned in the above tutorials I am suppose to derive my class called SchoolContext from the DbContext class available under the namespace System.Data.Entity.
I have set a reference for the System.Data.Entity dll by adding reference to the project , and have also mentioned the line "using System.Data.Entity;" , even then I am not able to derive from the class DbContext and nor even able to use the DbSet .
Please let me know what needs to be done to resolve the same.Please refer the link provided above to see the source code.
Regards
推荐答案
^ ]说,您需要添加对EntityFramework.dll的引用,而不是"System.Data.Entity dll"
MSDN[^] says you need to add a reference to EntityFramework.dll not "System.Data.Entity dll"
这篇关于为什么不能从DbContext类派生?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!