Ejemplo n.º 1
0
        public async Task <IActionResult> GetCard(int cardId)
        {
            try
            {
                var domainCard = await cardsService.GetCard(cardId);

                return(Ok(MapDomainToCardResponse(domainCard)));
            }
            catch (ArgumentException)
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> GetCard(int id)
        {
            if (!User.Identity.IsAuthenticated)
            {
                throw new AuthenticationException();
            }
            var card = await _cardsService.GetCard(id);

            var cardDto  = _mapper.Map <CardsDto>(card);
            var response = new ApiResponse <CardsDto>(cardDto);

            return(Ok(response));
        }
Ejemplo n.º 3
0
 public async Task <IActionResult> GetCard(string multiverseid)
 {
     return(Ok(await _cardsService.GetCard(multiverseid)));
 }