예제 #1
0
        public static ISchemaBuilder AddConvention <T>(
            this ISchemaBuilder builder,
            CreateConvention conventionFactory,
            string?scope = null)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.AddConvention(typeof(T), conventionFactory, scope));
        }
        public static IRequestExecutorBuilder AddConvention <T>(
            this IRequestExecutorBuilder builder,
            CreateConvention conventionFactory,
            string?scope = null)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder.ConfigureSchema(
                       b => b.AddConvention(typeof(T), conventionFactory, scope)));
        }
예제 #3
0
        public ISchemaBuilder AddConvention(Type convention, CreateConvention factory)
        {
            if (convention is null)
            {
                throw new ArgumentNullException(nameof(convention));
            }

            if (factory is null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            _conventions[convention] = factory;
            return(this);
        }
예제 #4
0
        public static ISchemaBuilder TryAddConvention(
            this ISchemaBuilder builder,
            Type convention,
            CreateConvention conventionFactory,
            string?scope = null)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (convention is null)
            {
                throw new ArgumentNullException(nameof(convention));
            }

            return(builder.TryAddConvention(convention, conventionFactory, scope));
        }
        public static IRequestExecutorBuilder TryAddConvention(
            this IRequestExecutorBuilder builder,
            Type convention,
            CreateConvention factory,
            string?scope = null)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (convention is null)
            {
                throw new ArgumentNullException(nameof(convention));
            }

            if (factory is null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            return(builder.ConfigureSchema(b => b.TryAddConvention(convention, factory, scope)));
        }
 public static IRequestExecutorBuilder TryAddConvention <T>(
     this IRequestExecutorBuilder builder,
     CreateConvention conventionFactory,
     string?scope = null)
     where T : IConvention =>
 builder.ConfigureSchema(b => b.TryAddConvention(typeof(T), conventionFactory, scope));
예제 #7
0
 public static ISchemaBuilder TryAddConvention <T>(
     this ISchemaBuilder builder,
     CreateConvention conventionFactory,
     string?scope = null)
     where T : IConvention =>
 builder.TryAddConvention(typeof(T), conventionFactory, scope);