update sample (#57)

pull/58/head
Rick Anderson 2022-09-19 16:27:45 -10:00 committed by GitHub
parent 4f1f7edbd4
commit 2361e29610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,8 @@ public class ValuesController : ControllerBase
{
if (Denominator == 0)
{
var errorType = new MathErrorFeature { MathError = MathErrorType.DivisionByZeroError };
var errorType = new MathErrorFeature { MathError =
MathErrorType.DivisionByZeroError };
HttpContext.Features.Set(errorType);
return BadRequest();
}
@ -27,7 +28,8 @@ public class ValuesController : ControllerBase
{
if (radicand < 0)
{
var errorType = new MathErrorFeature { MathError = MathErrorType.NegativeRadicandError };
var errorType = new MathErrorFeature { MathError =
MathErrorType.NegativeRadicandError };
HttpContext.Features.Set(errorType);
return BadRequest();
}