예제 #1
0
        public ActionResult GetAll()
        {
            var models = EstablishmentRepository.All()
                         .OrderBy(e => e.Academies.Name)
                         .Select(e => EstablishmentModel.ToModel(e));

            return(View(models));
        }
예제 #2
0
 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));
 }