private ActionResult GetHelloView(User user) { try { ViewBag.Name = vk.GetName(user); ViewBag.friends = vk.GetFriends(user); return(View("Hello")); } catch (TokenExpiredException) { userRepo.Remove(user.Ip); return(View("Login")); } }
public void SetFriends() { VkApi vkApi = new VkApi(); VkApiResponse <UserDTO> friendsResp = vkApi.GetFriends(Id.ToString()); if (friendsResp.Response != null) { FriendsList = new List <VkUser>(); foreach (UserDTO friend in friendsResp.Response.Items) { AddFriend(friend); } } }