Created
June 21, 2018 00:55
-
-
Save dcomartin/0974d9736789ccc080e6019282f7dbf6 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
public IActionResult AddToAccount() | |
{ | |
var problem = new OutOfCreditProblemDetails | |
{ | |
Type = "https://example.com/probs/out-of-credit", | |
Title = "You do not have enough credit.", | |
Detail = "Your current balance is 30, but that costs 50.", | |
Instance = "/account/12345/msgs/abc", | |
Balance = 30.0m, | |
Accounts = { "/account/12345","/account/67890" } | |
}; | |
return BadRequest(problem); | |
} | |
public class OutOfCreditProblemDetails : Microsoft.AspNetCore.Mvc.ProblemDetails | |
{ | |
public OutOfCreditProblemDetails() | |
{ | |
Accounts = new List<string>(); | |
} | |
public decimal Balance { get; set; } | |
public ICollection<string> Accounts { get; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment