コード例 #1
0
        public ActionResult Create(Customer customer)
        {
            if (ModelState.IsValid)
            {
                context.Customers.Add(customer);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(customer);
        }
コード例 #2
0
 public CustomerViewModel(Customer customer)
 {
     Customer = customer;
     States = new StatesDictionary();
 }