/** * Returns results of search the jobs data by key/value, using * inclusion of the search term. */ public List <Cosmetic> FindByColumnAndValue(CosmeticFieldType column, string value) { IList <Cosmetic> cosmetics = Cosmetics .Include(f => f.Finish) .Include(c => c.Color) .Include(c => c.Formulation) .Include(r => r.Rating) .Include(s => s.SkinType) .ToList(); var results = from j in cosmetics where GetFieldByType(j, column).Contains(value) select j; return(results.ToList()); }
public List <Cosmetic> FindByValue(string value) { var results = from j in Cosmetics.Include(c => c.Color) .Include(c => c.Formulation) .Include(c => c.SkinType) .Include(c => c.Rating) .Include(c => c.Finish) .ToList() where j.Color.Contains(value) || j.Finish.Contains(value) || j.Name.ToLower().Contains(value.ToLower()) || j.Formulation.Contains(value) || j.Rating.Contains(value) || j.SkinType.Contains(value) select j; return(results.ToList()); }