枚举支持实体框架数据库 [英] Enum Support for Entity Framework Database First

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

问题描述

我可以找到一堆关于如何实现模型首先和代码的枚举支持的教程,如下所示:

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

http://msdn.microsoft.com/en-us/data/jj248772.aspx

http://msdn.microsoft.com/ en-us / data / hh859576.aspx

任何人都可以向我解释或提供有关如何正确实施数据库第一个应用程序的枚举支持的一些说明。我想象我必须从edmx设计师开始,右键单击表中的一列并转换为枚举?感谢任何建议。我正在使用.NET 4.5和Enity Framework 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设计器中的列类型更改为该枚举的类型。重新整理了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!

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

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