Exemplo n.º 1
0
 public int Create(Friend obj)
 {
     var Frnd = cont.Friends.Single(e => e.UID == obj.UID && e.FrID ==obj.FrID && e.GID== obj.GID);
        if (Frnd != null)
        {
        return Frnd.FId;
        }
        cont.Friends.AddObject(obj);
        cont.SaveChanges();
        return Frnd.FId;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new Friend object.
 /// </summary>
 /// <param name="fId">Initial value of the FId property.</param>
 public static Friend CreateFriend(global::System.Int32 fId)
 {
     Friend friend = new Friend();
     friend.FId = fId;
     return friend;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Friends EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToFriends(Friend friend)
 {
     base.AddObject("Friends", friend);
 }