示例#1
0
        public async Task <PlayersDTO> GetById(int id)
        {
            var objPlayers = await _playersService.GetById(id);

            PlayersDTO players = _playersMapper.MapperToDTO(objPlayers);

            return(players);
        }
 public async Task <IHttpActionResult> GetById(int id)
 {
     return(await TryCatchAsync(async() =>
     {
         var player = await _playersServices.GetById(id);
         return Ok(player);
     }));
 }
示例#3
0
        public async Task <IActionResult> EditPlayer(int id)
        {
            var dto = await _playersService.GetById(id);

            var model = _mapper.Map <PlayerDto, PlayerViewModel>(dto);

            model.Action = Action.Edit;
            return(View("EditPlayer", model));
        }