VkNet.Categories.FriendsCategory.AreFriends C# (CSharp) Méthode

AreFriends() private méthode

private AreFriends ( [ userIds, bool needSign = null ) : FriendStatus>.IDictionary
userIds [
needSign bool
Résultat FriendStatus>.IDictionary
        public IDictionary<long, FriendStatus> AreFriends([NotNull]IEnumerable<long> userIds, bool? needSign = null)
        {
            if (userIds == null)
            {
                throw new ArgumentNullException("userIds");
            }

            var parameters = new VkParameters {
                { "user_ids", userIds },
                { "need_sign", needSign }
            };

            VkResponseArray ids = _vk.Call("friends.areFriends", parameters);

            return ids.ToDictionary(r => (long)r["user_id"], r => (FriendStatus)r["friend_status"]);
        }

Usage Example

Exemple #1
0
 public void AreFriends_EmptyAccessToken_ThrowAccessTokenInvalidException()
 {
     var cat = new FriendsCategory(new VkApi());
     Assert.That(() => cat.AreFriends(new long[] { 2, 3 }), Throws.InstanceOf<AccessTokenInvalidException>());
 }
All Usage Examples Of VkNet.Categories.FriendsCategory::AreFriends