Beispiel #1
0
        public static InsqlResolverBuilder AddScripter(this InsqlResolverBuilder builder, Action <ResolveScripterOptions> configure)
        {
            builder.Services.TryAdd(ServiceDescriptor.Singleton <IInsqlResolveScripter, ResolveScripter>());
            builder.Services.TryAdd(ServiceDescriptor.Singleton <IConfigureOptions <ResolveScripterOptions>, ResolveScripterOptionsSetup>());

            if (configure != null)
            {
                builder.Services.Configure(configure);
            }

            return(builder);
        }
Beispiel #2
0
        public static InsqlResolverBuilder AddFilter(this InsqlResolverBuilder builder, IInsqlResolveFilter filter)
        {
            builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(filter));

            return(builder);
        }
Beispiel #3
0
        public static InsqlResolverBuilder ClearFilters(this InsqlResolverBuilder builder)
        {
            builder.Services.RemoveAll <IInsqlResolveFilter>();

            return(builder);
        }
Beispiel #4
0
        public static InsqlResolverBuilder AddFilter <T>(this InsqlResolverBuilder builder) where T : class, IInsqlResolveFilter
        {
            builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton <IInsqlResolveFilter, T>());

            return(builder);
        }