Ejemplo n.º 1
0
        internal DirectiveCollection(
            object source,
            IEnumerable <DirectiveDefinition> directiveDefinitions)
        {
            if (directiveDefinitions is null)
            {
                throw new ArgumentNullException(nameof(directiveDefinitions));
            }

            _source      = source ?? throw new ArgumentNullException(nameof(source));
            _definitions = directiveDefinitions.ToList();
            _location    = DirectiveHelper.InferDirectiveLocation(source);
        }
Ejemplo n.º 2
0
        public DirectiveCollection(
            object source,
            IEnumerable <DirectiveDefinition> directiveDefinitions)
        {
            if (directiveDefinitions is null)
            {
                throw new ArgumentNullException(nameof(directiveDefinitions));
            }

            _source      = source ?? throw new ArgumentNullException(nameof(source));
            _definitions = directiveDefinitions.Any()
                ? directiveDefinitions.ToArray()
                : Array.Empty <DirectiveDefinition>();
            _location = DirectiveHelper.InferDirectiveLocation(source);
        }