public ActionResult Create(DivisionType divisiontype) { if (ModelState.IsValid) { db.DivisionTypes.AddObject(divisiontype); db.SaveChanges(); return RedirectToAction("Index"); } return View(divisiontype); }
public ActionResult Edit(DivisionType divisiontype) { if (ModelState.IsValid) { db.DivisionTypes.Attach(divisiontype); db.ObjectStateManager.ChangeObjectState(divisiontype, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(divisiontype); }
/// <summary> /// Deprecated Method for adding a new object to the DivisionTypes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToDivisionTypes(DivisionType divisionType) { base.AddObject("DivisionTypes", divisionType); }
/// <summary> /// Create a new DivisionType object. /// </summary> /// <param name="divisionTypeId">Initial value of the DivisionTypeId property.</param> /// <param name="description">Initial value of the Description property.</param> /// <param name="isGrandChampionDivision">Initial value of the IsGrandChampionDivision property.</param> public static DivisionType CreateDivisionType(global::System.Int32 divisionTypeId, global::System.String description, global::System.Boolean isGrandChampionDivision) { DivisionType divisionType = new DivisionType(); divisionType.DivisionTypeId = divisionTypeId; divisionType.Description = description; divisionType.IsGrandChampionDivision = isGrandChampionDivision; return divisionType; }