public List <Role> ReadRoles() { var eRoles = _iDRole.Read <ERole>(a => true, "RoleName"); var roles = eRoles.Select(a => new Role { RoleId = a.RoleId, RoleName = a.RoleName }); return(roles.ToList()); }
public Role Read(int roleId) { var eRole = _iDRole.Read <ERole>(a => a.RoleId == roleId); return(Role(eRole)); }
public bool HasRole(int credentialId, string[] roles) { var eRoles = _iDRole.Read <ERole>(a => a.CredentialRoles.Any(b => b.CredentialId == credentialId), "Name"); return(eRoles.Any(a => roles.Contains(a.Name))); }
public List <Role> Read(string sortBy) { var eRoles = _iDRole.Read <ERole>(a => true, sortBy); return(Roles(eRoles)); }