对于实体框架数据库支持ENUM第一实体、框架、数据库、ENUM

2023-09-02 21:48:14 作者:幻烟

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

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和相应的实体框架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!