Code
IList VendorList;
VendorList = session
.CreateCriteria<VendorLookup>()
.Add(Expression.Eq("NetworkRunId", networkRunId))
.Add(Expression.Not(Expression.Eq("VendorName", " ")))
.SetResultTransformer(new NHibernate.Transform.DistinctRootEntityResultTransformer())
.AddOrder(new Order("VendorName", true))
.List<IVendorLookup>().Distinct<IVendorLookup>().ToList();
Generated Query Please help me out
SELECT this_.Sp as HCO1_25_0_,
this_.NID as Network2_25_0_,
this_.Vname as HCO3_25_0_
FROM HCO_V_Lookup this_
WHERE this_.NID = 5 /* @p0 */
and not (this_.VNAME = ' ' /* @p1 */)
ORDER BY this_.VNAME asc