public async Task LookupFriendshipAsync(IUserModel user) { IFriendshipModel model = StorageService.GetCachedFriendship(user.ScreenName); if (model == null) { var option = Const.GetDictionary(); option.Add(Const.USER_ID, user.Id); var friendships = await tokens.Friendships.LookupAsync(option); if (friendships != null && friendships.Count != 0) { model = new FriendshipModel(friendships[0]); } } if (model == null) { return; } var connections = model.Connections.Select(c => c.ToLower()).ToList(); user.IsFollowing = connections.Contains(Const.FOLLOWING); user.IsFollowedBy = connections.Contains(Const.FOLLOWED_BY); StorageService.AddOrUpdateCachedFriendship(model); }