예제 #1
0
        public async Task <IActionResult> GetPendingFriends()
        {
            var userId = _userManager.GetUserId(HttpContext.User);
            var ids    = _friendsRepository.GetPendingFriends(userId).ToList();

            IList <User> result = new List <User> {
            };

            foreach (var id in  ids)
            {
                var email = (await _userManager.FindByIdAsync(id)).Email;
                result.Add(new Models.User {
                    Id = id, Email = email
                });
            }
            return(new OkObjectResult(result));
        }
예제 #2
0
 /// <summary>
 /// Get a list of all Pending friends by the userId
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public List <Friend> GetRequestingFriends(int userId) => _repository.GetPendingFriends(userId);
예제 #3
0
 public List <Friend> GetPendingFriends(int userId)
 {
     return(_context.GetPendingFriends(userId));
 }