3

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 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

If you go this way you can use the component or one-to-one mappings
2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.