错误:创建新控制器时出现“不支持的上下文类型" [英] Error:'Unsupported context type' while creating a new controller

查看:142
本文介绍了错误:创建新控制器时出现“不支持的上下文类型"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将使用ASP.NET MVC3,Linq to Sql类而不是Entity Framework,MS SQL Server 2008 pro而不是Express ed实现MvcMusicStore.

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.

我从 mvcmusicstore.codeplex.com

我将Linq用于Sql类,其数据上下文为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 to SQL-您必须使用Entity Framework. (或者不要使用脚手架,手动构建自己的控制器/动作逻辑.或者使用

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.)

这篇关于错误:创建新控制器时出现“不支持的上下文类型"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆