Minor refactoring for the CreateOrder Web API method and the Entity base class

This commit is contained in:
Cesar De la Torre 2017-05-04 12:29:00 -07:00
parent b1c0c72ec7
commit c247261929
2 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
commandResult = await _mediator.SendAsync(command); commandResult = await _mediator.SendAsync(command);
} }
return commandResult ? (StatusCodeResult)Ok() : (StatusCodeResult)BadRequest(); return commandResult ? (IActionResult)Ok() : (IActionResult)BadRequest();
} }

View File

@ -50,6 +50,9 @@
if (Object.ReferenceEquals(this, obj)) if (Object.ReferenceEquals(this, obj))
return true; return true;
if (this.GetType() != obj.GetType())
return false;
Entity item = (Entity)obj; Entity item = (Entity)obj;
if (item.IsTransient() || this.IsTransient()) if (item.IsTransient() || this.IsTransient())