Get Profile Photo

Mar 17, 2013 at 11:27 PM
Hi, I'm having trouble getting a User's profile picture url. I know you need to use the User class but no matter how I declare it I cannot get anything like User.ProfileImageURL popping up with Intellitext. Its almost like the class is empty, however I assume I am doing something wrong.

How would I declare a User for the currently authenticated user from the active TwitterContext in order to access these properties?
Coordinator
Mar 17, 2013 at 11:33 PM
Hi,

TwitterContext.User is a queryable entity, IQueryable<User>. You need to perform a query to get user details, probably a User/Show query in this case. Here's a quick example:
            var users =
                from tweet in twitterCtx.User
                where tweet.Type == UserType.Show &&
                      tweet.ScreenName == "JoeMayo"
                select tweet;

            var user = users.SingleOrDefault();
@JoeMayo
Mar 17, 2013 at 11:41 PM
Works perfectly, thanks again.