コード例 #1
0
 public ActionResult Edit(PublicHouseViewModel publicHouse)
 {
     if (ModelState.IsValid)
     {
         _publicHouseService.Update(publicHouse);
         return(RedirectToAction("Index"));
     }
     return(View(publicHouse));
 }
コード例 #2
0
        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));
        }