I have a C# app in Visual studio coded. One of the parts of this app is to sort coupons. Right now, coupons are sorted in descending order by end date. There is an option already in there to make coupons exclusive offers. I was wondering if there was a way to sort coupons by sort order, then by exlusivity, and then by the end date.
Here is a sample of the code:
var allLocalCoupons = merchant.Coupons
.Where(c => c.IsActive
&& c.StartDate <= DateTime.Now
&& (c.EndDate > DateTime.Now || c.EndDate == null)
&& (c.ExclusiveCouponOffer == ApplicationCode ||
c.ExclusiveCouponOffer == null))
.OrderBy(c => c.EndDate)
.ToList();