/// <summary> /// Deprecated Method for adding a new object to the CommitteeSet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCommitteeSet(Committee committee) { base.AddObject("CommitteeSet", committee); }
public ActionResult AddCommittee(CommitteeViewModel cvm) { if(ModelState.IsValid) { using (new UnitOfWork(_currentContext)) { var committee = new Committee { Name = cvm.Name, Description = cvm.Description }; committeeRepository.Add(committee); } TempData[Const.ActionResultInfo] = "Цикловая комиссия успешно добавлена"; return RedirectToAction("Committees"); } TempData[Const.ActionErrorInfo] = "Ошибка добавления цикловой комиссии. Проверьте правильность введенных данных"; return View(); }
/// <summary> /// Create a new Committee object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static Committee CreateCommittee(global::System.Int32 id, global::System.String name) { Committee committee = new Committee(); committee.Id = id; committee.Name = name; return committee; }