public AbstractApiResult Update(string id, CartEditItem item) { var command = new CartUpdateCommand(id, item); var result = Bus.Submit(command); if (NotificationHandler.HasNotifications()) { return(ValidationErrorResult()); } return(result.Success ? (AbstractApiResult) new SuccessApiResult(HttpStatusCode.OK, result.Data) : (AbstractApiResult) new FailureApiResult(HttpStatusCode.BadRequest, result.Message)); }
protected CartCommand(Guid id, CartEditItem Item) : this(id) { item = Item ?? new CartEditItem(); }
public CartUpdateCommand(string id, CartEditItem item) : base(Guid.Parse(id), item) { }
public IActionResult Patch([FromRoute] string id, [FromBody] CartEditItem item) { return(_cartService.Update(id, item)); }