I'm working with someone else's code, and am unfamiliar with NHibernate. I've been trying to learn the syntax and make a simple modification. I've googled and searched and have been unable to find an example that mimic's the way this is coded. It's possible the solution is simple, but I might not be searching for the right thing. At any rate, here's my method:
Code:
public static List<CarDes> RetrieveCarsByGroupId(int CarGroupId) {
if (CarGroupId== -1) return null;
CarGroup cg = GenericFactory<CarGroup >.RetrieveByPrimaryKey(CarGroupId);
List<CarDes> ret = null;
CarDes[] l = CarDes.FindAll(
new ICriterion[] {
Expression.Eq("CarGrpCd", cg)
}
);
if (l.Length > 0) ret = new List<CarDes>();
foreach (CarDes in l) {
ret.Add(f);
}
return ret;
}
I simply need to add: 'orderby carmanufact desc'
Code complete references being able to pass an Order type as the first parameter of FindAll(Order order, params ICriterion criteria), or an array of Order[] orders, but everything has failed.
Thanks in advance!