public async Task <IHttpActionResult> GetAllCards(CardRequestModel cardsRequest)
        {
            if (cardsRequest == null || !ModelState.IsValid)
            {
                return(BadRequest("Requires object with list of providerIds"));
            }

            var cards = await _cardsService.GetAllCards();

            return(Ok(cards));
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> GetAllCards()
 {
     try
     {
         return(Ok(await _cardsService.GetAllCards()));
     }
     catch (Exception ex)
     {
         var errorMessage = "There was an error while trying to list Word Cards from MongoDB";
         return(BadRequest(errorMessage + "\n" + ex));
     }
 }