// // GET: /Account/ public ActionResult Index() { DataRepository helper = new DataRepository(); string username = Session["Username"].ToString(); IList<Item> mostRecentItems = helper.getItemsByUser(username); //initialise item view model but filter by single user logged in IList<FollowConnection> friends = helper.getFollowConnections(username); ViewData["Friends"] = friends; return View(new ItemViewModel(null, null, null, null, null, mostRecentItems, username, "User","" , "", false, "", "", "","")); }
public ActionResult Unfollow(int Id) { DataRepository helper = new DataRepository(); helper.deleteConnectionById(Convert.ToInt32(Id)); string username = Session["Username"].ToString(); IList<FollowConnection> friends = helper.getFollowConnections(username); ViewData["Friends"] = friends; return PartialView(); }