using System; using System.Collections.Generic; namespace EnvelopeGenerator.Domain.Interfaces { public interface IDocument { IEnumerable #if nullable ? #endif ElementsBase { get; } } public static class DocumentExtensions { public static bool IsSigned(this IDocument document) { if(document.ElementsBase == null) throw new ArgumentNullException(nameof(document.ElementsBase), "Elements collection cannot be null. Please add with Includ()"); foreach (var element in document.ElementsBase) if (!element.IsSigned()) return false; return true; } } }