Hello all.
I have the following that pulls through a list of suppliers:
public List<tblSupplierPerformance> GetSupplierInfo(string memberid, string locationid, string supplieridname)
{
MyEntities suppliers = new MyEntities();
var r = (from p in suppliers.tblSupplierPerformances
where p.MemberId == memberid && p.LocationId == locationid
orderby p.TotalPurchaseQuantity
select p)
.Distinct();
if (supplieridname != "0")
r = r.Where(p => p.SupplierIDName == supplieridname);
return r.ToList();
}
However, when this runs, the orderby doesn't seem to be ordering.
I think, think, I need to implement the orderby at the "return r." stage, but I don't really know how to do this or I could be very much wrong all over the shop!
Any pointers gladly received.