tags:

views:

666

answers:

2

Consider the following table structure...

Appointment

ID integer Description nvarchar StatusID smallint

Status

ID smallint DisplayText nvarchar

Now, for good or for evil, we want this situation to map to a class that looks like this

class Appointment {
public int ID {g;s;} public string Description { g;s; } public string Status { g; private s; } }

I.e. we want to pull the normalised status display text straight into the entity.

+2  A: 

The obvious answer is to create a Status entity and make the appointment class have a reference to that and map it in the normal way.

chrismeek
If you go this way you can use the component or one-to-one mappings
Darren
A: 

Don't create an entity class. Use an enum and EnumStringType as shown here. This is exactly what you want I think.

Tim Scott