public ComponentServerCached GetComponentServerCached( string name, IReadOnlyDictionary <string, RoleCached> roles) { if (ServerComponents.TryGetValue(name, out ComponentServerCached componentServerCached)) { if (componentServerCached.Roles.Any(x => roles.Keys.Any(role => String.Equals(x.Value.Name, role, StringComparison.OrdinalIgnoreCase)))) { return(componentServerCached); } } return(null); }