예제 #1
0
        public IActionResult GetRecipePeanutButter([FromServices] IRecipe recipe)
        {
            try
            {
                IResponse response = null;

                recipe.GetPeanutButterRecipe();
                return(ResultFormatter.Format(200, response));          // ok
            }
            catch (NYIException exc)
            {
                return(ResultFormatter.Format(501, exc));           // not yet implemented
            }
            catch (Exception exc)                                   // catch-all exception try/catch block
            {
                _logger.LogError(exc, "GET recipe/peanutbutter unexpected error.");
                return(ResultFormatter.Format(500, exc));
            }
        }