Exemple #1
0
        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);
        }
Exemple #2
0
        public async Task <ActionResult> Start()
        {
            try
            {
                GetNameGameView names = await _gameService.GetOrderedUsers();

                return(View(names));
            }
            catch (Exception exeption)
            {
                return(View("~/Views/Shared/Error.cshtml", exeption));
            }
        }
Exemple #3
0
        public async Task <IHttpActionResult> GetName()
        {
            try
            {
                GetNameGameView names = await _gameService.GetOrderedUsers();

                return(Ok(names));
            }
            catch (Exception exception)
            {
                return(BadRequest(exception.Message));
            }
        }