public void OnGet() { _beerCollectionservice = new beerCollectionService(_beerCollectionRepository); _friendService = new friendService(_friendRespository, _userRepository); var userId = User.FindFirst(ClaimTypes.NameIdentifier).Value; userCollectionCount = _beerCollectionservice.getUserCollectionCount(userId); userCollectionRemainingCount = _beerCollectionservice.getUserCollectionRemaningCount(userId); userFriendId = _friendService.getUserFriendId(userId); }
public IActionResult OnPost() { if (ModelState.IsValid) { service = new friendService(_friendRespository, _userRepository); service.addFriend(User.FindFirst(ClaimTypes.NameIdentifier).Value, friend); return(RedirectToPage("/Dashboard")); } else { return(Page()); } }
public IActionResult OnPost() { currentUser = User.FindFirst(ClaimTypes.NameIdentifier).Value; if (ModelState.IsValid) { service = new friendService(_friendRespository, _userRepository); var result = service.removeFriend(currentUser, friendId); return(RedirectToPage("/removeFriend")); } else { currentUser = User.FindFirst(ClaimTypes.NameIdentifier).Value; friendList = _friendRespository.GetFriends(currentUser); return(Page()); } }