Example #1
0
        public IActionResult GetAllCards()
        {
            try
            {
                var cards = _repoWrapper.Card.GetAllCards();
                _loggingManager.LogInfo($"Returned all cards from database");

                var cardDtos = _mapper.Map <IEnumerable <Card_Read_Dto> >(cards);
                return(Ok(cardDtos));
            }
            catch (Exception ex)
            {
                _loggingManager.LogError($"Something went wrong in the GetAllCards action : {ex.Message}");
                return(StatusCode(500, "Internal Server Error"));
            }
        }