public virtual async Task <NotificationResult> InsertAsync(InsertShoplistIngredientCommand command) { BeginTransaction(); var result = await _handler.InsertAsync(command); return(Commit(result)); }
public virtual async Task <NotificationResult> InsertAsync(InsertShoplistIngredientCommand command) { var result = new NotificationResult(); var item = new ShoplistIngredientInfo(command); result.Add(item.GetNotificationResult()); if (!result.IsValid) { return(result); } result.Add(await _shoplistIngredientRepository.InsertAsync(item)); if (result.IsValid) { result.Data = item.Id; result.AddMessage(Shared.Domain.Resources.Handler.InsertSuccess_Message); } else { result.AddErrorOnTop(Shared.Domain.Resources.Handler.InsertError_Message); } return(result); }
public ShoplistIngredientInfo(InsertShoplistIngredientCommand command) { Map(command); this.InsertOrUpdateScopeValidate(); }
public async Task <IActionResult> Post([FromBody] InsertShoplistIngredientCommand command) { var result = await _service.InsertAsync(command); return(Ok(result)); }