I have Customers table: Customer(id, name status_id).
I have Statuses table: Status(id, name, code).
There is relation (FK) between Customer and Status: status_id (Customer) = id (Status).
In the .NET code I have Status enum and Customer class:
enum Status {
status_1,
status_2,
status_3,
status_4
}
class Customer {
public virtual long id {get;set;}
public virtual string name {get;set;}
public virtual Status customer_status {get;set;}
}
The enums doesn't have the values of the statuses rows from the db because I don't want to create dependency of the data in the code (hard coded).
How can I use the entity framework in order to present the customer class in the edmx?
EDIT:
All the solutions I found assumes that the enum values are the same as the status_id in Customer table. They even doesn't have the Status table which is very importent to me in order to make constraint on the values possibility of status_id