Example #1
0
        public static IActionResult Unauthorized(this Controller ctrl, ErrorKey key)
        {
            var result = ctrl.StatusCode(StatusCodes.Status401Unauthorized, new ErrorDto(key));

            return(result);
        }
Example #2
0
 public ErrorDto(ErrorKey key)
 {
     Errors.Add(new ErrorModel(key.Message, key.Code));
 }