如何获得的枚举mvc4工作与实体框架5 Beta 2的? [英] How to get enums working in mvc4 with Entity Framework 5 Beta 2?

查看:113
本文介绍了如何获得的枚举mvc4工作与实体框架5 Beta 2的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的NuGet更新到实体框架5.0.0-β2在我MVC3 - > MVC4项目

I used Nuget to update to Entity Framework 5.0.0-beta2 in my MVC3 -> MVC4 project.

我试图让枚举的工作,每一个迁移我补充一点忽略枚举领域。

I'm trying to get the enums to work, and each migration I add just ignores the enum fields.

我发现这在web.config中:

I found this in the web.config:

  <configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

我如何得到这个引用更新为EF5?

How do I get this reference updated to EF5?

难道这就是我需要获得枚举工作?

Is that what I need to get enums working?

推荐答案

我找到了答案,这对<一个href=\"http://thedatafarm.com/blog/data-access/moving-projects-from-ef-4-1-2-3-ndash-gt-ef5beta-don-rsquo-t-do-what-i-did/\">Julie勒曼的博客。

解决方法是删除EF5的NuGet包,更新应用到.NET 4.5的目标,然后添加的NuGet为EF5测试回来,很显然,当你的目标.NET 4.0的NuGet包将增加EF4.4代替5。

The solution is to remove the EF5 Nuget package, update the app to target .net 4.5 and then add the Nuget for EF5 Beta back in. Apparently when you are targeting .net 4.0 the Nuget package will add EF4.4 instead of 5.

这篇关于如何获得的枚举mvc4工作与实体框架5 Beta 2的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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