var q = (dc.tblHelpCentreQuestions.Where(c => c.userID == UserID));
q.OrderByDescending(c => c.dateSubmitted);
I’m just getting used to Linq, and I’m sorting my records by date submitted descending, but could someone explain to me why I have to do c => c.dateSubmitted and not just pass in tblHelpCentreQuestions.dateSubmitted? What does the c=> do and why is it needed?
It is a lambda expression. Read about them here.
Also note that OrderByDescending returns a new IEnumerable, it does not do an in-place sort. You will want to read about Linq basics here.