It all depends on what the return type of the user.GetFollowers(int i)
is.
And in what context is user
defined?
You seem to be a bit confused about the basics of C#.
private
is simply specifying that you cannot access your member outside the context of your class. It is not a data-type.
See this question for more info about access-modifiers as they are called
What is the difference between Public, Private, Protected, and Nothing?
The keyword var
is just compliler-magic, and cannot be used for properties or other members of a class.
To implement a member of class (be it a field, property or method) you must know the return-type.
In your case; the easiest way to get it is just to see what user.GetFollowers(int i)
returns, the fastest way to do this is to simply browse to it by putting your cursor on it and go to it by pressing the F12 key in visual studio.
You have tagged your question with tweetinvi so I'm going to assume this has something to do with twitter.
For this example, i will just call the unknown types FriendCollection
, FollowerCollection
and FavoriteCollection
. Since "GetFriends" seems to suggest that it will return some sort of collection.
public class TwitterUserInfo
{
public FriendCollection Friends { get; get; }
public FollowerCollection Followers { get; set; }
public FavoriteCollection Favorites { get; set; }
public TwitterUserInfo(TwitterUser user)
{
Friends = user.GetFriends(20);
Followers = user.GetFollowers(20);
Favorites = user.GetFavorites(20);
}
}
You can then use it as such:
TwitterUserInfo userInfo = new TwitterUserInfo(someTwitterUser);
And the "userInfo" will then contain the properties you want. for example userInfo.Friends
will contain the friends.
Since you have not provided much information about what is going on, i cannot give a more elaborate answer.
EDIT: Cleared up a few things