public ActionResult Create([Bind(Include = "ServiceID,Name,ServiceText")] Service service) { if (ModelState.IsValid) { db.Services.Add(service); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(service)); }
public ActionResult Create([Bind(Include = "FlightID,FlightClassID,From,Destination" + ",CompanyName,Departure,Price,DepartureTime,Capacity")] Flight flight) { if (ModelState.IsValid) { db.Flights.Add(flight); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FlightClassID = new SelectList(db.FlightClasses, "FlightClassID", "FlightClassKind", flight.FlightClassID); return(View(flight)); }
public void Save() { db.SaveChanges(); }