public IActionResult Edit(Person person)
        {
            if (ModelState.IsValid)
            {
                _personRepo.Edit(person);
                return(RedirectToAction("list"));
            }

            return(View());
        }
Beispiel #2
0
        public IHttpActionResult Edit(int id, PersonViewModel personViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var updatePerson = _personRepo.Edit(id, personViewModel);

            return(Ok(updatePerson));
        }