I have the following LINQ query:
Person
.OrderBy(x => x.FirstName)
.Where(x => x.FirstName.Contains("a"));
I can also write this query in the following way:
Person
.Where(x => x.FirstName.Contains("a"))
.OrderBy(x => x.FirstName);
Both of them have the same result. So here's my question, What is the difference between the two queries? Which one is better? And why?