public static IApplicationInfoProperties RemoveFromBlacklist(this IApplicationInfoProperties properties, Uri[] replicasToRemove) { var blacklist = new HashSet <Uri>(properties.GetBlacklist()); if (!replicasToRemove.Intersect(blacklist).Any()) { return(properties); } blacklist.ExceptWith(replicasToRemove); return(properties.SetBlacklist(blacklist)); }
public static IApplicationInfoProperties AddToBlacklist(this IApplicationInfoProperties properties, Uri[] replicasToAdd) { var blacklist = new HashSet <Uri>(properties.GetBlacklist()); if (blacklist.IsSupersetOf(replicasToAdd)) { return(properties); } blacklist.UnionWith(replicasToAdd); return(properties.SetBlacklist(blacklist)); }