public ActionResult List() { var model = new TournamentListModel { Tournaments = _tournamentService.GetAll().Select(x => x.ToModel()).ToList() }; return View(model); }
public ActionResult List(TournamentListModel model, DataSourceRequest command) { var tournaments = _tournamentService.GetAll(model.SearchType, model.SearchName).Select(x => x.ToModel()).ToList(); var gridModel = new DataSourceResult { Data = tournaments.PagedForCommand(command).Select(x => x), Total = tournaments.Count }; return Json(gridModel); }