WCF Ria服务向导不使用CodeFirst [英] WCF Ria Services Wizard not working with CodeFirst

查看:114
本文介绍了WCF Ria服务向导不使用CodeFirst的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用EF Code First时,出现在VS 2012中的WCF RIA服务向导(在添加新的DomainService时运行)无法识别项目中定义的DbContext(它只能识别ObjectContext)。



这意味着当在VS2012中添加新项目并选择添加DomainServiceClass时,该向导无法检测可用的上下文类*组合列表为空*



请看附件



有什么想法可能发生在这里?
谢谢,
-Sumit

解决方案

这是Visual Studio 2012,WCF RIA服务和实体框架的一个已知问题,因为向导创建新的域服务不知道DbContext类型。



简单的解决方案是继续使用Visual Studio 2010创建实体模型。虽然使用RIAServices.EntityFramework NuGet软件包没有工作,因为它不支持当前的实体框架版本。



另一个解决方案是将您的上下文的类型从 DbContext to ObjectContext



Theres还有一个知识库文章针对该具体情况。



更新:
WCF的更新Ria Services已发布,以支持EF 5和DbContext的使用。更多信息可以找到 here


When using EF Code First, It appears WCF RIA Services Wizard (that runs when adding a new DomainService) in VS 2012 does not recognize the DbContexts defined in the project (it only recognizes the ObjectContext).

This means that when Adding a New Item in VS2012 and choosing Add DomainServiceClass, the wizard is not able to detect available context classes * combo list is empty *

Please see the attached image

Any idea what could be happening here? Thanks, -Sumit

解决方案

This is a known issue with Visual Studio 2012, WCF RIA Services and Entity Framework, cause the Wizard to create new Domain Services doesn´t know the DbContext types.

The simple solution is to continue using Visual Studio 2010 to create Entity Models. Although using RIAServices.EntityFramework NuGet package won´t work, cause it doesn´t support current Versions of Entity Framework.

Another solution is to change the type of your Context from DbContext to ObjectContext.

Theres also a KB article for that specific scenario.

Update: An update to WCF Ria Services was released to support EF 5 and the usage of DbContext. More information can be found here.

这篇关于WCF Ria服务向导不使用CodeFirst的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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