gpt4 book ai didi

asp.net-mvc - 创建新 Controller 时出现错误 :'Unsupported context type'

转载 作者:行者123 更新时间:2023-12-01 12:50:44 24 4
gpt4 key购买 nike

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

我从mvcmusicstore.codeplex.com得到教程

我使用了 Linq to Sql 类,Datacontext 是 MvcMusicSrotedataContext。当我尝试使用这个创建一个新类时

image

当我点击添加按钮错误时,它在新窗口中显示错误:'Unsupported context Type'

那么,你能帮我解决这个问题吗?谢谢。

最佳答案

内置的 MVC 脚手架不支持 Linq to SQL——您必须改用 Entity Framework。 (或者不使用脚手架,手动构建您自己的 Controller /操作逻辑。或者使用支持 Linq to SQL 的 scaffolding plugin。)

关于asp.net-mvc - 创建新 Controller 时出现错误 :'Unsupported context type',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12555910/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com