Let’s say I have a linq query like the one below
var LinqResult =
from a in Db.Table
select new {Table = a};
From here, how can I grab a specific row from these results and put it on top?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That make the ordering rather explicit, by sorting on the numbers 1 or 2, depending on whether or not it’s the desired top value.
You could simplify that a bit, by sorting on the bool expression itself, except
false < true, so to get someId on top, you must either write:or