Entity Framework - Using a lookup (picklist) table with a lookup key

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-05-03T18:42:15Z Indexed on 2010/05/03 18:48 UTC
Read the original article Hit count: 465

Filed under:
|
|
|

I'm working on a WPF application that is working well using the Entity Framework (3.5 SP1) for complicated table structures. The problem now is I want to get a list from the EF that includes lookups into a picklist table that has multiple picklists in it.

In SQL I would write a sub select as such:

SELECT Name, (Select typeName from PickLists where type_id = items.type_id and picklist_key=333) as Type_desc FROM Items

There are no Foreign keys for this, and the picklists table is never updated using the EF, so it is read only as far as the EF is concerned.

I'm not sure the best method to put this into the model if at all.

I'm displaying in a read-only datagrid on a dashboard.

Thanks!

© Stack Overflow or respective owner

Related posts about entity

Related posts about framework