错误:“不支持的上下文类型”,而创建一个新的CONTROLER [英] Error:'Unsupported context type' while creating a new controler
问题描述
我要MvcMusicStore使用ASP.NET MVC3实现,LINQ到SQL类,而不是实体框架,MS SQL Server 2008的亲,而不是前preSS版
I am going to implement MvcMusicStore using ASP.NET MVC3, Linq to Sql class instead of Entity Framework, MS SQL Server 2008 pro instead of express ed.
我使用LINQ到SQL类和DataContext的是MvcMusicSrotedataContext。当我尝试使用它来创建一个新的类
I used Linq to Sql class and the Datacontext is MvcMusicSrotedataContext. When i try to create a new class using this
这表明在新窗口中一个错误,当我点击添加按钮错误:'不支持的情况下键入
it shows an error in a new window when i click add button Error:'Unsupported context Type'
所以,请你帮我解决这个问题?
谢谢。
So, could you please help me to solve this? Thank You.
推荐答案
内置的MVC脚手架不支持LINQ到SQL - 你将不得不使用实体框架来代替。 (或不使用脚手架,手工打造您自己的控制器/动作逻辑,或者使用<一个href=\"http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/\"相对=nofollow>脚手架插件,支持LINQ到SQL 。)
The built-in MVC scaffolding doesn't support Linq to SQL -- you'll have to use Entity Framework instead. (Or don't use the scaffolding, build your own controller/action logic manually. Or use a scaffolding plugin that supports Linq to SQL.)
这篇关于错误:“不支持的上下文类型”,而创建一个新的CONTROLER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!