コード例 #1
0
        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)));
        }
コード例 #2
0
ファイル: FriendController.cs プロジェクト: FaridFG/SciCo
        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));
        }
コード例 #3
0
 public RequestsPage()
 {
     this.InitializeComponent();
     _vm = DataContext as RequestsVM;
 }