예제 #1
0
 public IActionResult Update(UpdatePersonModelView updatePerson)
 {
     if (ModelState.IsValid)
     {
         Person person = new Person
         {
             FristName = updatePerson.FirstName,
             LastName  = updatePerson.LastName,
             Address   = updatePerson.Address,
             Email     = updatePerson.Email,
             Id        = updatePerson.id
         };
         _personRepository.Update(person);
     }
     return(View(updatePerson));
 }
예제 #2
0
        public IActionResult Update(int personid)
        {
            var result = _personRepository.Get(personid);

            if (result != null)
            {
                UpdatePersonModelView model = new UpdatePersonModelView
                {
                    id        = result.Id,
                    Email     = result.Email,
                    Address   = result.Address,
                    LastName  = result.LastName,
                    FirstName = result.FristName,
                };
                return(View(model));
            }
            return(NotFound());
        }