Imagine you have two tables - Orders and OrderStates - and the obvious relationship that every Order is in a particular state. Let's say that both have a int primary key Id. The order states will never change and are in database for only design and ui purposes. That being said you would want to create an Enum type representing the order states. However, the entity framework has already generated classes using the order state int value/key.
What are the possible solutions for given problem? Remeber that the question is about EF1 or EF .NET 3.5 if you will and that you start with a already designed database (database first approach). I work with the old version because I am currently developing an application for Sharepoint 2010 which runs on .NET 3.5.
I have only found solutions for EF4 or higher like this one: Enum Support for Entity Framework Database First
To make it clearer, I would like to avoid casting the int all the time. The generated code forces you to write either:
(OrderStates)OrderState.State == OrderState.StateX;
OR
OrderState.State == (int)OrderState.StateX;
It could be ok in case you get to such a situation just once, but that is usually not the case. Also the enum's code readability is higher than just some int value.