Exemplo n.º 1
0
        public async Task <IActionResult> GetRange([FromQuery] int offset = 0, [FromQuery] int limit = 10)
        {
            var userId  = GetUserId();
            var players = await _service.GetAllPlayers(offset, limit, userId);

            return(Ok(players));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetAllPlayers()
        {
            try
            {
                return(Ok(await playerService.GetAllPlayers()));
            }

            catch (Exception e)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, e));
            }
        }
Exemplo n.º 3
0
        public async Task <IActionResult> GetAllPlayers(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = PLAYERS)] HttpRequest req,
            ILogger log)
        {
            try
            {
                log.LogInformation($"C# HTTP trigger function processed a request {nameof(GetAllPlayers)}.");

                var allPlayerDtos = await _playersService.GetAllPlayers();

                var response = new ResponseModel <IEnumerable <PlayerDto> >(allPlayerDtos, req.Path);
                return(new OkObjectResult(response));
            }
            catch (Exception ex)
            {
                log.LogError(ex, "_");
                throw;
            }
        }
Exemplo n.º 4
0
 public IEnumerable <ProfileDto> Get()
 {
     return(playersService.GetAllPlayers().Select(p => MakeDto(p)));
 }
Exemplo n.º 5
0
        public ActionResult AllPlayers()
        {
            IEnumerable <PlaayersVm> model = service.GetAllPlayers();

            return(View(model.ToList()));
        }
        /// <summary>
        /// Displays all users whose profile status is acceptable
        /// </summary>
        /// <returns></returns>
        public IActionResult DisplayAllPlayers()
        {
            var model = service.GetAllPlayers();

            return(this.View(model));
        }