コード例 #1
0
        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));
        }
コード例 #2
0
 protected CartCommand(Guid id, CartEditItem Item)
     : this(id)
 {
     item = Item ?? new CartEditItem();
 }
コード例 #3
0
 public CartUpdateCommand(string id, CartEditItem item)
     : base(Guid.Parse(id), item)
 {
 }
コード例 #4
0
 public IActionResult Patch([FromRoute] string id, [FromBody] CartEditItem item)
 {
     return(_cartService.Update(id, item));
 }