public static IActionResult Unauthorized(this Controller ctrl, ErrorKey key) { var result = ctrl.StatusCode(StatusCodes.Status401Unauthorized, new ErrorDto(key)); return(result); }
public ErrorDto(ErrorKey key) { Errors.Add(new ErrorModel(key.Message, key.Code)); }