public IList<User> LookupUsers(User user, AgeRange ageRange) { var lookupCriteria = BuildLookupCriteria(user); if(ageRange != null){ var beginDate = new GetInDate(DateTime.Now).Subtract(ageRange.To); var endDate = new GetInDate(DateTime.Now).Subtract(ageRange.From); lookupCriteria.Add(Restrictions.Between("DateOfBirth", beginDate, endDate)); } return lookupCriteria.List<User>(); }
public virtual IList<User> LookupUsers(AgeRange ageRange) { return Repository.LookupUsers(this, ageRange); }