public IActionResult Put([FromBody] BongViewModel BongViewModel) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(Response(BongViewModel)); } _BongAppService.Update(BongViewModel); return(Response(BongViewModel)); }
public IActionResult Create(BongViewModel BongViewModel) { if (!ModelState.IsValid) { return(View(BongViewModel)); } _BongAppService.Register(BongViewModel); if (IsValidOperation()) { ViewBag.Sucesso = "Bong Registered!"; } return(View(BongViewModel)); }
public IActionResult Edit(BongViewModel BongViewModel) { if (!ModelState.IsValid) { return(View(BongViewModel)); } _BongAppService.Update(BongViewModel); if (IsValidOperation()) { ViewBag.Sucesso = "Bong Updated!"; } return(View(BongViewModel)); }
public void Update(BongViewModel BongViewModel) { var updateCommand = _mapper.Map <UpdateBongCommand>(BongViewModel); Bus.SendCommand(updateCommand); }
public void Register(BongViewModel BongViewModel) { var registerCommand = _mapper.Map <RegisterNewBongCommand>(BongViewModel); Bus.SendCommand(registerCommand); }