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)); }
public async Task <IActionResult> GetAllPlayers() { try { return(Ok(await playerService.GetAllPlayers())); } catch (Exception e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e)); } }
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; } }
public IEnumerable <ProfileDto> Get() { return(playersService.GetAllPlayers().Select(p => MakeDto(p))); }
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)); }