public ActionResult RemoveFriend(RemoveFriendViewModel viewModel) { var userId = User.Identity.GetUserId(); Member member = db.Members.FirstOrDefault(m => m.ApplicationUserId == userId); db.FriendPairs.Remove(db.FriendPairs.FirstOrDefault(p => p.FriendId == viewModel.Friend.Id && p.ListId == member.Id)); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult RemoveFriend(Guid id) { RemoveFriendViewModel viewModel = new RemoveFriendViewModel { Friend = db.Members.Find(id) }; return(View(viewModel)); }