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); } }
public User GetUserByLoginWithRoles(string login) { var user = GetUserByLogin(login); if (user is null) { return(null); } user.Roles = _rolesDao.GetRolesByUserId(user.ID).ToList(); return(user); }