Created
February 12, 2018 08:44
-
-
Save bymyslf/1a4b5005d2a0905596a3e9b1bd1355d9 to your computer and use it in GitHub Desktop.
This file contains 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 ConflictObjectResult : ObjectResult | |
{ | |
public ConflictObjectResult(string detail) | |
: base(detail) | |
=> StatusCode = StatusCodes.Status409Conflict; | |
} | |
public static class ControllerExtensions | |
{ | |
public static IActionResult Conflict(this Controller controller, string detail) | |
=> new ConflictObjectResult(detail); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment