Browse Source

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

pull/190/head
Cesar De la Torre 7 years ago
parent
commit
c247261929
2 changed files with 4 additions and 1 deletions
  1. +1
    -1
      src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs
  2. +3
    -0
      src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs

+ 1
- 1
src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs 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();
} }


+ 3
- 0
src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs 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())


Loading…
Cancel
Save