Do you use enums in your data applications and how?

Posted by Ivan on Stack Overflow See other posts from Stack Overflow or by Ivan
Published on 2010-05-23T15:45:19Z Indexed on 2010/05/23 15:50 UTC
Read the original article Hit count: 301

Filed under:
|
|
|
|

My practice shows that a general enterprise application has a lot of entities which's nature corresponds to an elementary enumeration. For example We may have an Order entity which may have such fields as "OrderType", "OrderStatus", "Currency", etc. referencing corresponding Entities which are nothing more than just a textual name bound to a key to be referenced.

Using enums would look very natural here. But entities have to be defined in application code at design-time, am I right? While in we need to be able to CRUD enum value variants at runtime and use enums in server-side SQL queries (like stored procedures and views).

What are you practices and thoughts on this subject?

I am particularly interested in C#4, linq and T-SQL.

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql