Exemplo n.º 1
0
        public ActionResult AddFriends(AddFriendRequest addFriendRequest, int id)
        {
            if (!_validator.ValidateAddFriends())
            {
                return(BadRequest());
            }
            var user = _memberRepo.GetMember(id);

            user.Friends.Add(addFriendRequest.FriendId);
            var friends = user.GetFriends();

            return(Accepted($"api/members/{user.Id}/friends", friends));
        }