MVC模型中的问题(给我快速回复) [英] Problen in MVC model(Give me Fast Reply)
问题描述
嗨..
我已经学会了MVC使用此链接
http://www.asp.net/mvc/教程/getting-started-with-aspnet-mvc3/cs/adding-a-model [
Hi..
i have learn MVC use this link
http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/adding-a-model[^]
but i have proble in DBContext code.Error:DbContext not be found..
public class MovieDBContext : DbContext
{
public DbSet<Movie> Movies { get; set; }
}
如果没有DBContext,请给我帮助或其他在MVC中使用数据绑定的方法.
Thankx ....
Give me help or other way to use databinding in MVC.Withoout DBContext.
Thankx....
推荐答案
对于类文件,您需要添加Linq引用(System.Data.Linq
).请按照以下步骤操作:
Hi,
In the case of class files, you need to add Linq referance(System.Data.Linq
). Follow the steps:
1.右键单击该项目->添加参考
2.转到.Net选项卡
3.选择System.Data.Linq,然后单击确定.
4.使用Linq
命名空间using System.Data.Linq;
1. Right click on the project --> Add Reference
2. Go to .Net tab
3. Select System.Data.Linq and click ok.
4. Use Linq
namespace using System.Data.Linq;
请参考此链接 [
Refer this link[^] for more information.
All the best.
--Amit
DBContext位于 ^ ]命名空间,请随意添加对EntityFramework.dll的引用.如果未安装,请使用nuget或独立安装程序: http://nuget.org/packages/EntityFramework [ ^ ]
DBContext is in the System.Data.Entity[^] namespace, add reference to EntityFramework.dll assambly. If it is not installed use nuget, or the standalone installer: http://nuget.org/packages/EntityFramework[^]
使用System.Data.Linq;
您可以使用Ctrl +.
using System.Data.Linq;
u can use Ctrl + .
这篇关于MVC模型中的问题(给我快速回复)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!