Ejemplo n.º 1
0
        public static IStitchingBuilder AddSchemaFromLocal(this IStitchingBuilder stitchingBuilder,
                                                           string serviceName, ISchemaBuilder schemaBuilder, IWebHostEnvironment env, IServiceCollection services)
        {
            var schemaName = $"AG_{serviceName}";

            stitchingBuilder.AddQueryExecutor(schemaName, sp => schemaBuilder.AddServices(sp).Create().MakeExecutable());

            // Add extensions (for types that get stitched in from this service)
            stitchingBuilder.AddExtensionsFromFileForService(serviceName, env);

            return(stitchingBuilder);
        }
Ejemplo n.º 2
0
        public static IStitchingBuilder AddSchema(
            this IStitchingBuilder builder,
            NameString name,
            ISchema schema)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (schema == null)
            {
                throw new ArgumentNullException(nameof(schema));
            }

            name.EnsureNotEmpty(nameof(name));

            builder.AddQueryExecutor(name, s => schema.MakeExecutable());

            return(builder);
        }