使用与代码优先和放大器枚举;实体框架5 [英] Using Enums with Code First & Entity Framework 5

查看:148
本文介绍了使用与代码优先和放大器枚举;实体框架5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想确认一个印象:似乎在EF5 +代码首先枚举相同的命名空间利用他们作为物业类型的类中声明时,只支持

Just trying to confirm an impression: it seems enums in EF5 + Code First are only supported when declared within the same namespace as the classes using them as property types.

谁能证实?找不到该网页上的任何东西......

Can anyone confirm that? Couldn't find anything on the web for this...

推荐答案

一个相关的错误,前面是固定的。 4.3 Beta 1的发布说明称:

A relevant bug that was fixed earlier. 4.3 Beta 1 release notes say:

错误的 GetDatabaseValues 修复。在早期版本中这一方法将美元,如果你的实体类和背景在不同的命名空间b $ B失败。
此问题现在是固定的,类不需要在同一
命名空间使用GetDatabaseValues

Bug fix for GetDatabaseValues. In earlier releases this method would fail if your entity classes and context were in different namespaces. This issue is now fixed and the classes don’t need to be in the same namespace to use GetDatabaseValues.

我的猜测是, GetDatabaseValues 功能依然专用小汽车此之际(不过这只是一个猜测)。你可能想在这里报告如下:的 ADO.NET团队博客:EF5 Beta 1的可用

My guess is that GetDatabaseValues function is still buggy for this occasion (but that's just an educated guess). You may want to report this here: ADO.NET team blog: EF5 Beta 1 Available

这篇关于使用与代码优先和放大器枚举;实体框架5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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