c# - How to order by two fields? -
this question has answer here:
- multiple “order by” in linq 6 answers
how order startdate , userlikeproduct? need sort startdate show userlikeproduct first.
public ienumerable<check> gethomeceeck() { return this.query() .where(c => c.ispublish && c.ishomepageproduct) .orderby(c => c.startdate) .take(30) .tolist(); }
if understand correctly, want order 1 , other?
use .thenby(lambda) after .orderby(lambda).
if not meant let me know , i'll remove answer
.orderby(c => c.startdate).thenby(c => c.like)
Comments
Post a Comment