views:

38

answers:

1

I have several tables that all reference the same lookup table. Is it generally a good idea to attach the BelongsTo attribute to each table that references a FK from a lookup table? Or should I model the foreign keys as a property and simply link the two tables while constructing my detached criteria?

+1  A: 

Not sure I understand the question, but if you're asking whether to do this:

[BelongsTo("id_lookup")]
public virtual Lookup Lookup {get;set;}

or this:

[Property("id_lookup")]
public virtual int Lookup {get;set;}

The answer is: use the first one.

Mauricio Scheffer

related questions