diff --git a/eShopOnContainers-ServicesAndWebApps.sln b/eShopOnContainers-ServicesAndWebApps.sln index cf2be1c26..eb0e83e02 100644 --- a/eShopOnContainers-ServicesAndWebApps.sln +++ b/eShopOnContainers-ServicesAndWebApps.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26403.7 +VisualStudioVersion = 15.0.26403.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{932D8224-11F6-4D07-B109-DA28AD288A63}" EndProject diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index d9a3752ed..05a9cd193 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -30,25 +30,21 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers [HttpPost] public async Task CreateOrder([FromBody]CreateOrderCommand command, [FromHeader(Name = "x-requestid")] string requestId) { - bool result = false; + bool commandResult = false; if (Guid.TryParse(requestId, out Guid guid) && guid != Guid.Empty) { var requestCreateOrder = new IdentifiedCommand(command, guid); - result = await _mediator.SendAsync(requestCreateOrder); + commandResult = await _mediator.SendAsync(requestCreateOrder); } else { // If no x-requestid header is found we process the order anyway. This is just temporary to not break existing clients // that aren't still updated. When all clients were updated this could be removed. - result = await _mediator.SendAsync(command); + commandResult = await _mediator.SendAsync(command); } - if (result) - { - return Ok(); - } + return commandResult ? (StatusCodeResult)Ok() : (StatusCodeResult)BadRequest(); - return BadRequest(); } [Route("{orderId:int}")]