public CspDirective Union(CspDirective other) { // Remove duplicates. var expressions = Expressions .Union(other.Expressions) .ToArray(); var hasNone = expressions.Any(e => e == "'none'"); if (hasNone) { return(new CspDirective( Name, expressions .Where(e => e != "'none'") .ToArray() )); } return(new CspDirective( Name, expressions )); }
protected bool Equals(CspDirective other) { return(Name == other.Name && Expressions.SequenceEqual(other.Expressions)); }