Esempio n. 1
0
        public IEnumerable <MContainer> GetAllUserContainers(int userId)
        {
            var user       = _userRepository.GetById(userId);
            var containers = _receiptRepository.GetAll()
                             .Where(r => r.User == user)
                             .Select(r => r.Container);

            return(containers);
        }
Esempio n. 2
0
 public User GetCurrentUser(HttpContext http)
 {
     return(_userRepository.GetById(int.Parse(http.User
                                              .Claims.First(c => c.Type == JwtRegisteredClaimNames.Sub)
                                              .Value)));
 }