public ActionResult Index() { string[] include = new string[] { "CoachType", "Club" }; var coaches = _coachService.GetAllCoaches(include); var mapper = new CoachListViewModelMapper(); var vm = mapper.From(coaches); return(View(vm)); }
public IActionResult GetAllCoaches() { try { var coaches = coachService.GetAllCoaches(); return(Ok(mapper.Map <IEnumerable <CoachPL> >(coaches.ToList()))); } catch (Exception ex) { return(StatusCode(500, "Internal server error. Exception message: " + ex)); } }
public ActionResult AllCoaches() { IEnumerable <CoachVm> model = service.GetAllCoaches(); return(View(model.ToList())); }