6
Good morning!
I would like to know how to order two columns at once in a query so that in my case, 1 in descending order of date but in alphabetical order.
public IList<Analise> ListaTodosOrdenado()
{
using (ISession _session = FHibernateHelper.AbreSession())
{
var analises = _session.QueryOver<Analise>()
.JoinQueryOver(p => p.MateriaPrima)
.TransformUsing(Transformers.DistinctRootEntity)
.List();
var a = analises.OrderByDescending(d => d.DataCadastro).OrderBy(n=>n.MateriaPrima.Nome);
return (analises);
}
}
In these lines of code, it first orders by date, but the second ordering overrides the first.
http://stackoverflow.com/a/4658205/2221388 See if this can help you
– Pablo Tondolo de Vargas
Thanks Paulo, it worked!!
– Vini Leal