public static bool AddBlockedUser(int userId, int blockedId) { using (var db = new TwitterOnVaadinEntities()) { var blockedUsers = new BlockedList { BlockedUser = blockedId, User = userId, }; db.BlockedLists.AddObject(blockedUsers); db.SaveChanges(); } return true; }
/// <summary> /// Create a new BlockedList object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="user">Initial value of the User property.</param> /// <param name="blockedUser">Initial value of the BlockedUser property.</param> public static BlockedList CreateBlockedList(global::System.Int32 id, global::System.Int32 user, global::System.Int32 blockedUser) { BlockedList blockedList = new BlockedList(); blockedList.id = id; blockedList.User = user; blockedList.BlockedUser = blockedUser; return blockedList; }
/// <summary> /// Deprecated Method for adding a new object to the BlockedLists EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBlockedLists(BlockedList blockedList) { base.AddObject("BlockedLists", blockedList); }