Exemplo n.º 1
0
        public async Task <IActionResult> Get(string id)
        {
            try
            {
                if (string.IsNullOrEmpty(id))
                {
                    return(BadRequest());
                }

                var result = await _quizManager.GetAnswerByIdAsync(id);

                if (result != null)
                {
                    return(new OkObjectResult(result));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"[Error ] {ex}");
                return(BadRequest());
            }

            return(NotFound());
        }