/// <summary> /// Create a new Group object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static Group CreateGroup(global::System.Int32 id, global::System.String name) { Group group = new Group(); group.Id = id; group.Name = name; return group; }
/// <summary> /// Deprecated Method for adding a new object to the GroupSet EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGroupSet(Group group) { base.AddObject("GroupSet", group); }
public Group CreateGroup(Group groupToCreate) { _entities.AddToGroupSet(groupToCreate); _entities.SaveChanges(); return groupToCreate; }
public void DeleteGroup(Group groupToDelete) { var originalGroup = GetGroup(groupToDelete.Id); _entities.DeleteObject(originalGroup); _entities.SaveChanges(); }
public ActionResult Delete(Group groupToDelete) { if (_service.DeleteGroup(groupToDelete)) return RedirectToAction("Index"); return View("Delete", _service.GetGroup(groupToDelete.Id)); }