示例#1
0
        private void Initialize(Action <IUnionTypeDescriptor> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var descriptor = new UnionTypeDescriptor(GetType());

            configure(descriptor);

            UnionTypeDescription description = descriptor.CreateDescription();

            _types = description.Types;
            _resolveAbstractType = description.ResolveAbstractType;
            Name        = description.Name;
            Description = description.Description;
        }
示例#2
0
        private void Initialize(Action <IUnionTypeDescriptor> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var descriptor = new UnionTypeDescriptor(GetType());

            configure(descriptor);

            UnionTypeDescription description = descriptor.CreateDescription();

            _types = description.Types;
            _resolveAbstractType = description.ResolveAbstractType;

            Initialize(description.Name, description.Description,
                       new DirectiveCollection(this,
                                               DirectiveLocation.Union,
                                               description.Directives));
        }