LINQ entity query performance

Posted by Abdel Olakara on Stack Overflow See other posts from Stack Overflow or by Abdel Olakara
Published on 2010-05-13T14:30:01Z Indexed on 2010/05/13 14:34 UTC
Read the original article Hit count: 253

Filed under:
|
|

Hi all,

I have a silly question. I would like to know if there is performance deference in these two quries:

var cObject = from cust in entities.Customer 
          where cust.id == cid
      select cust;

and

var cObject = entities.Customer.First( c=> c.id == cid);

My query return only one record as I am querying with the primary key. But do they make any difference?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about query