Good day.

Colleagues, is it possible in ASP.NET MVC to sort the list that contains the result of a database query, without re-accessing the database without using Session ["..."] or Session - the only way to store data in the server's memory between queries?

  • No, not the only one, there is also Cache , for example. And why not in the session? - Igor
  • Can. I just wanted to consider all the options. - Mark

1 answer 1

When using the Entity Framework, you can try to use:

  • .OrderByDescending (c => c.client_id) .ThenBy (c => c.Person.Fullname);
  • .clients.OrderBy (c => c.client_id).