public static bool AddFriendUser(int userId, int friendId) { using (var db = new TwitterOnVaadinEntities()) { var friendUser = new FriendList { Friend = friendId, User = userId, }; db.FriendLists.AddObject(friendUser); db.SaveChanges(); } return true; }
/// <summary> /// Create a new FriendList object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="user">Initial value of the User property.</param> /// <param name="friend">Initial value of the Friend property.</param> public static FriendList CreateFriendList(global::System.Int32 id, global::System.Int32 user, global::System.Int32 friend) { FriendList friendList = new FriendList(); friendList.id = id; friendList.User = user; friendList.Friend = friend; return friendList; }
/// <summary> /// Deprecated Method for adding a new object to the FriendLists EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToFriendLists(FriendList friendList) { base.AddObject("FriendLists", friendList); }