Ejemplo n.º 1
0
        public async Task <IActionResult> InitWordCards(string setting)
        {
            try
            {
                if (setting == "word")
                {
                    var result = await _cardsService.InitWordCards();

                    return(Ok(result));
                }
                else
                {
                    throw new Exception("Enter init to initialize DB!");
                }
            }
            catch (Exception ex)
            {
                var errorMessage = "There was an error while trying to list Word Cards from MongoDB";
                return(BadRequest(errorMessage + "\n" + ex));
            }
        }