Exemplo n.º 1
0
        public IDeleteResponse DeleteFriend([FromBody] DeleteFrnd frnd)
        {
            int count = 0;

            if (frnd.User_from != null && frnd.User_to != null)
            {
                count = Friends.Delete(frnd.User_from, frnd.User_to);
            }

            return(new DeleteResponse()
            {
                AffectedRecords = count
            });
        }
Exemplo n.º 2
0
        public void ClearFriendList(Friends Friends)
        {
            bool checkForMore;

            do
            {
                List <Friend> FriendsList = Friends.ToList();
                checkForMore = false;
                foreach (Friend Friend in FriendsList)
                {
                    if (this.Id == Friend.ContactId)
                    {
                        Friends.Delete(Friend.Id);
                        checkForMore = true;
                        break;
                    }
                }
            } while (checkForMore);
        }