public ActionResult Edit(PublicHouseViewModel publicHouse) { if (ModelState.IsValid) { _publicHouseService.Update(publicHouse); return(RedirectToAction("Index")); } return(View(publicHouse)); }
public async Task <IActionResult> Update([FromBody] UpdatePublicHouseViewModel itemVM) { if (itemVM == null) { return(NotFound()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _service.Update(itemVM); return(Ok(itemVM)); }