public IEnumerable <obj> SelectAllByProperty(string property, object value) { value = VerifyType.ConvertProperty(property, value, typeof(obj)); var result = Session.CreateCriteria(typeof(obj)).Add(Expression.Eq(property, value)).List <obj>(); Clear(); return(result); }
public obj SelectByProperty(string property, object value) { value = VerifyType.ConvertProperty(property, value, typeof(obj)); var result = Session.CreateCriteria(typeof(obj)).Add(Expression.Eq(property, value)).UniqueResult <obj>(); Clear(); return(result); }
public IEnumerable <obj> SelectAllByProperties(IEnumerable <CriteriaConditions> conditions) { var criteria = Session.CreateCriteria(typeof(obj)); foreach (var item in conditions) { item.Value = VerifyType.ConvertProperty(item.Property, item.Value, typeof(obj)); criteria.Add(Restrictions.Eq(item.Property, item.Value)); } var result = criteria.List <obj>(); Clear(); return(result); }