public async Task <IActionResult> Put(int id, [FromBody] UpdateShoplistCommand command) { command.Id = id; var result = await _service.UpdateAsync(command); return(Ok(result)); }
public virtual async Task <NotificationResult> UpdateAsync(UpdateShoplistCommand command) { BeginTransaction(); var result = await _handler.UpdateAsync(command); return(Commit(result)); }
public virtual async Task <NotificationResult> UpdateAsync(UpdateShoplistCommand command) { var result = new NotificationResult(); var item = new ShoplistInfo(command); result.Add(item.GetNotificationResult()); if (!result.IsValid) { return(result); } result.Add(await _shoplistRepository.UpdateAsync(item)); if (result.IsValid) { result.Data = item.Id; result.AddMessage(Shared.Domain.Resources.Handler.UpdateSuccess_Message); } else { result.AddErrorOnTop(Shared.Domain.Resources.Handler.UpdateError_Message); } return(result); }
public ShoplistInfo(UpdateShoplistCommand command) { Map(command); InitCollections(); this.InsertOrUpdateScopeValidate(); }