Пример #1
0
 public IEnumerable <Role> GetUsersRolesByLogin(string login)
 {
     try
     {
         var user = _usersDao.GetUserByLogin(login);
         return(_rolesDao.GetRolesByUserId(user.ID));
     }
     catch (SqlException e)
     {
         throw new DALException(DALType.SQL, e.Message, e);
     }
 }
Пример #2
0
        public User GetUserByLoginWithRoles(string login)
        {
            var user = GetUserByLogin(login);

            if (user is null)
            {
                return(null);
            }

            user.Roles = _rolesDao.GetRolesByUserId(user.ID).ToList();

            return(user);
        }