Beispiel #1
0
            private static DescriptorContext CreateContext(
                SchemaBuilder builder,
                LazySchema lazySchema)
            {
                IServiceProvider services = builder._services ?? new EmptyServiceProvider();
                var schemaInterceptors    = new List <ISchemaInterceptor>();
                var typeInterceptors      = new List <ITypeInitializationInterceptor>();

                InitializeInterceptors(services, builder._schemaInterceptors, schemaInterceptors);
                InitializeInterceptors(services, builder._typeInterceptors, typeInterceptors);

                var schemaInterceptor = new AggregateSchemaInterceptor(schemaInterceptors);
                var typeInterceptor   = new AggregateTypeInterceptor(typeInterceptors);

                DescriptorContext context = DescriptorContext.Create(
                    builder._options,
                    services,
                    builder._conventions,
                    builder._contextData,
                    lazySchema,
                    schemaInterceptor,
                    typeInterceptor);

                schemaInterceptor.OnBeforeCreate(context, builder);

                return(context);
            }
Beispiel #2
0
            public static DescriptorContext CreateContext(
                SchemaBuilder builder,
                LazySchema lazySchema)
            {
                IServiceProvider services = builder._services ?? new EmptyServiceProvider();

                var schemaInterceptor = new AggregateSchemaInterceptor();
                var typeInterceptor   = new AggregateTypeInterceptor();

                DescriptorContext context = DescriptorContext.Create(
                    builder._options,
                    services,
                    builder._conventions,
                    builder._contextData,
                    lazySchema,
                    schemaInterceptor,
                    typeInterceptor);

                return(context);
            }