public bool EditIntention(IntentionViewModel model, string modifiedBy) { var intention = base.FindIntentionById(model.Id); intention.Name = model.Name; intention.ModifiedBy = modifiedBy; this.Data.IntentionRepository.Update(intention); return(Convert.ToBoolean(this.Data.SaveChanges())); }
public IActionResult Put([FromBody] IntentionViewModel model) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(Response(model)); } intentionAppService.Update(model); return(Response(model)); }
public ActionResult Edit([Bind(Include = "Id,Name")] IntentionViewModel intentionModel) { try { var intention = this._intentionService.FindIntention(intentionModel.Id); if (this.ModelState.IsValid) { if (this._intentionService.EditIntention(intentionModel, this.User.Identity.Name)) { return(RedirectToAction("Details", "IntentionRecognition", new { id = intention.BotId })); } } return(View(intention)); } catch (NotFoundException ex) { return(HttpNotFound(ex.Message)); } }
public void Update(IntentionViewModel viewModel) { var updateCommand = _mapper.Map <UpdateIntentionCommand>(viewModel); _bus.SendCommand(updateCommand); }
public void Create(IntentionViewModel viewModel) { var command = _mapper.Map <CreateIntentionCommand>(viewModel); _bus.SendCommand(command); }