public virtual NHibernate.ICriteria PrepareOrder(ref NHibernate.ICriteria criteria) { if (this.IsClientSort()) { criteria.ClearOrders(); if (string.Compare(this.Order.Trim(), Asc, true) == 0) { criteria.AddOrder(NHibernate.Criterion.Order.Asc(this.Sort.Trim())); } if (string.Compare(this.Order.Trim(), Desc, true) == 0) { criteria.AddOrder(NHibernate.Criterion.Order.Desc(this.Sort.Trim())); } } return(criteria); }