What is the difference between these two statements (asp.net/c#/entity framework)

Posted by user318573 on Stack Overflow See other posts from Stack Overflow or by user318573
Published on 2010-05-25T22:14:14Z Indexed on 2010/05/25 22:21 UTC
Read the original article Hit count: 128

Filed under:
|
|
IEnumerable<Department> myQuery = (from D in myContext.Departments orderby D.DeptName select D);

var myQuery = (from D in myContext.Departments orderby D.DeptName select D);

What is the difference between these two statements above? In my little asp.net/C#/ EF4.0 app I can write them either way, and as far as how I want to use them, they both work, but there has to be a reason why I would choose one over the other?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET