From c247261929a3eba2e2fc24d4107ab6f412e4d3af Mon Sep 17 00:00:00 2001 From: Cesar De la Torre Date: Thu, 4 May 2017 12:29:00 -0700 Subject: [PATCH] Minor refactoring for the CreateOrder Web API method and the Entity base class --- .../Ordering/Ordering.API/Controllers/OrdersController.cs | 2 +- src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index 05a9cd193..c5b21aeef 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -43,7 +43,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers commandResult = await _mediator.SendAsync(command); } - return commandResult ? (StatusCodeResult)Ok() : (StatusCodeResult)BadRequest(); + return commandResult ? (IActionResult)Ok() : (IActionResult)BadRequest(); } diff --git a/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs b/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs index 7616a3230..086fbc904 100644 --- a/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs +++ b/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs @@ -50,6 +50,9 @@ if (Object.ReferenceEquals(this, obj)) return true; + if (this.GetType() != obj.GetType()) + return false; + Entity item = (Entity)obj; if (item.IsTransient() || this.IsTransient())