KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am beginning to use LINQ in general (so far toXML and toSQL). I've seen that sometimes there are two or more ways to achieve the same results. Take this simple example, as far as I understand both return exactly the same thing: SomeDataContext dc = new SomeDataContext(); var queue = from q in dc.SomeTable where q.SomeDate <= DateTime.Now && q.Locked != true orderby (q.Priority, q.TimeCreated) select q; var queue2 = dc.SomeTable .Where( q => q.SomeDate <= DateTime.Now && q.Locked != true ) .OrderBy(q => q.Priority) .ThenBy(q => q.TimeCreated); The idea is that there are two ways to express the same thing; I understand that the first method has some limitations and that the "dot notation" is more complete, but besides that, are there any other advantages?
Tags (comma-separated)
Save Edits
Cancel