public ActionResult List() { var model = new PlayerListModel() { Players = _playerService.GetAll() }; return View(model); }
public ActionResult List(PlayerListModel model, DataSourceRequest command) { var players = _playerService.GetAll(model.SearchLevel, model.SearchFullName); var resultData = command.Page > 0 && command.PageSize > 0 ? players.PagedForCommand(command).Select(x => x) : players; var gridModel = new DataSourceResult { Data = resultData, Total = players.Count }; return Json(gridModel); }