public ActionResult Register(User model) { if (ModelState.IsValid) { accountRepository.InsertUser(model); accountRepository.Save(); } return RedirectToAction("", "Home"); }
public void AddFriend(User friend) { Friends.Add(new UserFriend(){Friend = friend, DateCreated = DateTime.Now}); }
public bool IsFriends(User friend) { return (Friends.FirstOrDefault(u => u.FriendId == friend.ID) != null); }
public void RemoveFriend(User friend) { var friendship = Friends.FirstOrDefault(u => u.FriendId == friend.ID); if (friendship != null) Friends.Remove(friendship); }