Пример #1
0
        internal bool TryRemoveRelationship(Snowflake id, out CachedRelationship relationship)
        {
            var result = _relationships.TryRemove(id, out relationship);

            if (result)
            {
                relationship.User.SharedUser.References--;
            }

            return(result);
        }
Пример #2
0
        internal bool TryAddRelationship(CachedRelationship relationship)
        {
            var result = _relationships.TryAdd(relationship.Id, relationship);

            if (result)
            {
                relationship.User.SharedUser.References++;
            }

            return(result);
        }