diff --git a/fundamentals/middleware/problem-details-service/Controllers/ValuesController.cs b/fundamentals/middleware/problem-details-service/Controllers/ValuesController.cs
index 3a4472c..7d443b5 100644
--- a/fundamentals/middleware/problem-details-service/Controllers/ValuesController.cs
+++ b/fundamentals/middleware/problem-details-service/Controllers/ValuesController.cs
@@ -46,8 +46,7 @@ public class ValuesController : ControllerBase
{
var errorType = new MathErrorFeature
{
- MathError =
- MathErrorType.DivisionByZeroError
+ MathError = MathErrorType.DivisionByZeroError
};
HttpContext.Features.Set(errorType);
return BadRequest();
@@ -65,8 +64,7 @@ public class ValuesController : ControllerBase
{
var errorType = new MathErrorFeature
{
- MathError =
- MathErrorType.NegativeRadicandError
+ MathError = MathErrorType.NegativeRadicandError
};
HttpContext.Features.Set(errorType);
return BadRequest();
@@ -79,12 +77,12 @@ public class ValuesController : ControllerBase
}
//
-//
+//
[Route("api/[controller]/[action]")]
[ApiController]
public class Values3Controller : ControllerBase
{
- // /api/values/divide/1/2
+ // /api/values3/divide/1/2
[HttpGet("{Numerator}/{Denominator}")]
public IActionResult Divide(double Numerator, double Denominator)
{
@@ -92,12 +90,11 @@ public class Values3Controller : ControllerBase
{
var errorType = new MathErrorFeature
{
- MathError =
- MathErrorType.DivisionByZeroError
+ MathError = MathErrorType.DivisionByZeroError
};
HttpContext.Features.Set(errorType);
return Problem(
- title: "Wrong Input",
+ title: "Bad Input",
detail: "The number you inputed is zero",
type: "https://en.wikipedia.org/wiki/Division_by_zero",
statusCode: StatusCodes.Status400BadRequest
@@ -108,7 +105,7 @@ public class Values3Controller : ControllerBase
return Ok(calculation);
}
- // /api/values/squareroot/4
+ // /api/values3/squareroot/4
[HttpGet("{radicand}")]
public IActionResult Squareroot(double radicand)
{
@@ -116,12 +113,11 @@ public class Values3Controller : ControllerBase
{
var errorType = new MathErrorFeature
{
- MathError =
- MathErrorType.NegativeRadicandError
+ MathError = MathErrorType.NegativeRadicandError
};
HttpContext.Features.Set(errorType);
return Problem(
- title: "Wrong Input",
+ title: "Bad Input",
detail: "Negative or complex numbers are not handled",
type: "https://en.wikipedia.org/wiki/Square_root",
statusCode: StatusCodes.Status400BadRequest
@@ -133,4 +129,4 @@ public class Values3Controller : ControllerBase
}
}
-//
+//
diff --git a/fundamentals/middleware/problem-details-service/Program.cs b/fundamentals/middleware/problem-details-service/Program.cs
index 7f69089..3b56a73 100644
--- a/fundamentals/middleware/problem-details-service/Program.cs
+++ b/fundamentals/middleware/problem-details-service/Program.cs
@@ -1,4 +1,4 @@
-#define API_CONTROLLER // MIDDLEWARE API_CONTROLLER API_CONT_SHORT
+#define MIDDLEWARE // MIDDLEWARE API_CONTROLLER API_CONT_SHORT
#if NEVER
#elif MIDDLEWARE
//
@@ -42,7 +42,7 @@ app.Use(async (context, next) =>
HttpContext = context,
ProblemDetails =
{
- Title = "Wrong Input",
+ Title = "Bad Input",
Detail = details.Detail,
Type = details.Type
}
@@ -109,7 +109,7 @@ builder.Services.AddProblemDetails(options =>
};
context.ProblemDetails.Type = details.Type;
- context.ProblemDetails.Title = "Wrong Input";
+ context.ProblemDetails.Title = "Bad Input";
context.ProblemDetails.Detail = details.Detail;
}
}