public void AddSection(IDocumentSection section) { if (_sections.Any(s => string.Equals(s.Name, section.Name, StringComparison.OrdinalIgnoreCase))) throw new ArgumentException("Section name must be unique inside document", "section"); _sections.Add(section); }
public void AddSection(IDocumentSection section) { if (_sections.Any(s => string.Equals(s.Name, section.Name, StringComparison.OrdinalIgnoreCase))) { throw new ArgumentException("Section name must be unique inside document", "section"); } _sections.Add(section); }