コード例 #1
0
 /// <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;
 }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the GroupSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGroupSet(Group group)
 {
     base.AddObject("GroupSet", group);
 }
コード例 #3
0
 public Group CreateGroup(Group groupToCreate)
 {
     _entities.AddToGroupSet(groupToCreate);
     _entities.SaveChanges();
     return groupToCreate;
 }
コード例 #4
0
 public void DeleteGroup(Group groupToDelete)
 {
     var originalGroup = GetGroup(groupToDelete.Id);
     _entities.DeleteObject(originalGroup);
     _entities.SaveChanges();
 }
コード例 #5
0
 public ActionResult Delete(Group groupToDelete)
 {
     if (_service.DeleteGroup(groupToDelete))
         return RedirectToAction("Index");
     return View("Delete", _service.GetGroup(groupToDelete.Id));
 }