示例#1
0
        public ActionResult Create(PersonViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var person = viewModel.ConvertToPerson(db);
                db.Person.Add(person);
                db.SaveChanges();

                return(RedirectToAction("Grid"));
            }
            return(View(viewModel));
        }