Last active
February 9, 2018 09:00
-
-
Save bymyslf/edfeaaa72bf820f3210402283cca92fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Mvc; | |
| public class FailedPreconditionObjectResult : ObjectResult | |
| { | |
| public FailedPreconditionObjectResult(string detail) | |
| : base(detail) | |
| => StatusCode = StatusCodes.Status412PreconditionFailed; | |
| } | |
| public static class ControllerExtensions | |
| { | |
| public static IActionResult FailedPrecondition(this Controller controller, string detail) | |
| => new FailedPreconditionObjectResult(detail); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment