public ActionResult <string> Get(int id)
        {
            UserRelationships userRelationships = new UserRelationships();
            string            result            = userRelationships.GetRelationship(id);

            return(result);
        }
Esempio n. 2
0
        internal UserRelationship GetOrAddRelationshipWith(User target)
        {
            var relationship = UserRelationships.FirstOrDefault(r => r.ToUserId == target.Id);

            if (relationship == null)
            {
                relationship = new UserRelationship(this, target);
                UserRelationships.Add(relationship);
                Logger?.LogInformation($"New relationship with user {target.Id}");
            }
            return(relationship);
        }
Esempio n. 3
0
 public bool IsFriend(long userId)
 {
     return(UserRelationships.FirstOrDefault(r => r.ToUserId == userId)?.IsFriend ?? false);
 }