对于实体框架数据库支持ENUM第一 [英] Enum Support for Entity Framework Database First

查看:106
本文介绍了对于实体框架数据库支持ENUM第一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以找到关于如何实现模型的第一和code首先这样的枚举支持了一堆辅导:

I can find a bunch of tutorials on how to implement enum support for model first and code first like these:

<一个href="http://msdn.microsoft.com/en-us/data/jj248772.aspx">http://msdn.microsoft.com/en-us/data/jj248772.aspx

<一个href="http://msdn.microsoft.com/en-us/data/hh859576.aspx">http://msdn.microsoft.com/en-us/data/hh859576.aspx

任何人都可以向我解释或者我提供有关如何正确地实现数据库应用程序的第一枚举支持一些指令。我想像我不得不开始在EDMX设计器,然后右键单击我的列在表中之一,并转换为枚举?感谢您的任何建议。我使用.NET 4.5和相应的实体框架5.0

Can anyone explain to me or provide me with some instructions on how to properly implement enum support for database first applications. I'd imagine I'd have to start in the edmx designer and right click one of my columns in the tables and convert to enum? Thanks for any advice. I'm using .NET 4.5 and Enity Framework 5.0

推荐答案

我的清盘做的是改变了列式数据库为int然后,我走进了EDMX和更新型号从数据库中,然后我去,并增加了枚举类型,然后改变了列类型的EDMX设计是该枚举类型的。 Reupdated的POCO的,一切都会好的!

What I wound up doing is changing the column type to int in the database then I went into the edmx and updated model from database, then I went and added a enum type and then changed the column type in the edmx designer to be of type of that enum. Reupdated the poco's and everything Works good!

这篇关于对于实体框架数据库支持ENUM第一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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