public ActionResult Create(Customer customer) { if (ModelState.IsValid) { customerRepository.InsertOrUpdate(customer); customerRepository.Save(); return RedirectToAction("Index"); } else { return View(); } }
/// <summary> /// Create a new Customer object. /// </summary> /// <param name="customer_ID">Initial value of the Customer_ID property.</param> /// <param name="company_Name">Initial value of the Company_Name property.</param> public static Customer CreateCustomer(global::System.String customer_ID, global::System.String company_Name) { Customer customer = new Customer(); customer.Customer_ID = customer_ID; customer.Company_Name = company_Name; return customer; }
/// <summary> /// Deprecated Method for adding a new object to the Customers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCustomers(Customer customer) { base.AddObject("Customers", customer); }