public IActionResult GetPlayById(int id) { var play = _playRepository.GetPlayById(id); if (play == null) { return(NotFound("This Play is not in our playbook coach.")); } return(Ok(play)); }
public IActionResult GetPlayById(int playId) { var play = _playRepository.GetPlayById(playId); var playviewmodel = new CompletePlayViewModel() { PlayName = play.Name, FormationName = play.FormationName, Players = _playerRepository.GetPlayersFor(playId) }; if (play == null) { return(NotFound("This Play is not in our playbook coach.")); } return(Ok(playviewmodel)); }