public ActionResult GetAll() { var models = EstablishmentRepository.All() .OrderBy(e => e.Academies.Name) .Select(e => EstablishmentModel.ToModel(e)); return(View(models)); }
public ActionResult GetByFilter(string filter) { filter = filter.ToUpper(); return(Json(EstablishmentRepository.All() .Where(e => e.Name.ToUpper().Contains(filter) || e.Town.ToUpper().Contains(filter) || e.Academies.Name.ToUpper().Contains(filter) || e.Address.ToUpper().Contains(filter) || e.PostCode.Contains(filter) || e.Town.ToUpper().Contains(filter)) .Select(e => e.Id), JsonRequestBehavior.AllowGet)); }