public ActionResult Create(ClassName classname) { if (ModelState.IsValid) { db.ClassNames.Add(classname); db.SaveChanges(); return RedirectToAction("Index"); } return View(classname); }
/// <summary> /// Create a new ClassName object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static ClassName CreateClassName(global::System.Int32 id, global::System.String name) { ClassName className = new ClassName(); className.Id = id; className.Name = name; return className; }
/// <summary> /// Deprecated Method for adding a new object to the ClassNames EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToClassNames(ClassName className) { base.AddObject("ClassNames", className); }
public ActionResult Edit(ClassName classname) { if (ModelState.IsValid) { db.Entry(classname).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(classname); }
public void AddClass(ClassName className) { throw new NotImplementedException(); }