public IEnumerable <CUL> SearchCULs(string criteria) { return(cULsRepository .SearchData(c => c.Code.ToLower().Contains(criteria.ToLower()) || c.Description.ToLower().Contains(criteria.ToLower())) .Select(c => c.AutoMapObject <DB.CUL, CUL>()) .OrderByDescending(c => c.CULId)); }
private static bool ValidateCULNumber(string culNumber) { var culRepo = new CULsRepository(new PmcsDbContext()); var result = culRepo.SearchData(c => c.Description == culNumber || c.Code == culNumber); return(result.Any()); }