public virtual async Task <NotificationResult> InsertAsync(InsertRecipeIngredientCommand command) { BeginTransaction(); var result = await _handler.InsertAsync(command); return(Commit(result)); }
public virtual async Task <NotificationResult> InsertAsync(InsertRecipeIngredientCommand command) { var result = new NotificationResult(); var item = new RecipeIngredientInfo(command); result.Add(item.GetNotificationResult()); if (!result.IsValid) { return(result); } result.Add(await _recipeIngredientRepository.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 async Task <IActionResult> Post([FromBody] InsertRecipeIngredientCommand command) { var result = await _service.InsertAsync(command); return(Ok(result)); }
public RecipeIngredientInfo(InsertRecipeIngredientCommand command) { Map(command); this.InsertOrUpdateScopeValidate(); }