Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: GetUsersFromNames Value cannot be null issue

$
0
0
Hi Linvi

Im having an issue with GetUsersFromNames always returning null. I have a function that gets a list of user names

IEnumerable<string> users = connection.GetRecentUsers();

The funtion is returning the a list of usernames

and when I execute

IEnumerable<IUser> userCollection = User.UserFactory.GetUsersFromNames(users);

I get the following error
Value cannot be null.
Parameter name: collection


The getrecentusers function is just hardcoded at the moment

public IEnumerable <string> GetRecentUsers()
{

    List<string> list = new List<string>();
    list.Add("blindasfcuk");
    IEnumerable<string> users = list.AsEnumerable();

    return users;
}

When I run the same code with a list of user IDs returned I can use the GetUsersFromIDs function without any issue and id prefer to use this method but the tweetinvi API doenst expose the user ID from the tweetDTO so I only have access to usernames at the moment.

Cheers
Brian

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>