public async Task <IViewComponentResult> InvokeAsync() { AppUser user = await _userManager.FindByNameAsync(User.Identity.Name); RequestsVM model = new RequestsVM() { ReceiverUser = user, RequestorUsers = _db.FriendRequests.Where(r => r.ReceiverUser == user).Select(r => r.RequestorUser), Photos = _db.Photos }; return(View(await Task.FromResult(model))); }
public async Task <IActionResult> ShowFriendRequests() { AppUser user = await _userManager.FindByNameAsync(User.Identity.Name); RequestsVM model = new RequestsVM() { ReceiverUser = user, RequestorUsers = _db.FriendRequests.Where(r => r.ReceiverUser == user).Select(r => r.RequestorUser), Photos = _db.Photos }; return(View(model)); }
public RequestsPage() { this.InitializeComponent(); _vm = DataContext as RequestsVM; }