コード例 #1
0
 public int Update(Group obj)
 {
     var Grp = cont.Groups.Single(e => e.GId == obj.GId);
     if (Grp != null)
     {
         Grp.GName = obj.GName;
         return cont.SaveChanges();
     }
     return 0;
 }
コード例 #2
0
 public int Create(Group obj)
 {
     var Grp= cont.Groups.Single(e => e.GName == obj.GName);
       if (Grp != null)
       {
       return Grp.GId;
       }
       cont.Groups.AddObject(obj);
        cont.SaveChanges();
        return Grp.GId;
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Groups EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGroups(Group group)
 {
     base.AddObject("Groups", group);
 }
コード例 #4
0
 /// <summary>
 /// Create a new Group object.
 /// </summary>
 /// <param name="gId">Initial value of the GId property.</param>
 public static Group CreateGroup(global::System.Int32 gId)
 {
     Group group = new Group();
     group.GId = gId;
     return group;
 }