How to efficiently use Linq to Entities to read a central entity with associated lookup values RRS feed

  • Question

  • Hello

    I am looking for a way to get Employee information using Linq To Entities. I am looking for the best way to maximize performance so that I get the Employee information and the descriptions of code fields from associated lookup tables on the many side of the relationship (post-fixed with LKP). Some lookup rows may not be there, so I would expect null to be returned.

    I first considered Load, but using load would require several trips (as I understand). I also considered Include, but Include does not provide filtering of the included table values and I am not sure how to code include for all those lookups. I am not sure what to do in short of specifying the usual SQL.

    Also, does it make a difference if the data is read for update or just for display using EF?

    Your help is appreciated.

    Tuesday, May 1, 2012 1:42 AM


All replies