public async Task <GetNameGameView> GetOrderedUsers() { var players = new GetNameGameView(); players.Names = (await _playerRepository.GetByType(PlayerType.User)).OrderByDescending(x => x.Name).Select(s => s.Name).ToList(); return(players); }
public async Task <ActionResult> Start() { try { GetNameGameView names = await _gameService.GetOrderedUsers(); return(View(names)); } catch (Exception exeption) { return(View("~/Views/Shared/Error.cshtml", exeption)); } }
public async Task <IHttpActionResult> GetName() { try { GetNameGameView names = await _gameService.GetOrderedUsers(); return(Ok(names)); } catch (Exception exception) { return(BadRequest(exception.Message)); } }