示例#1
0
        public static void AddSQLBuilder(this IServiceCollection services, Action <SqlBuilderOptions> configure)
        {
            var options = new SqlBuilderOptions();

            configure(options);

            services.AddSingleton(options);
            services.AddScoped <ICharacterConverter, DefaultCharacterConverter>();
            services.AddScoped <ISqlMapper, SqlMapper>();

            foreach (var extension in options.Extensions)
            {
                extension.AddServices(services);
            }
        }
示例#2
0
        public static void UseMySQL(this SqlBuilderOptions opts)
        {
            var extension = new MySqlBuilderExtension();

            opts.RegisterExtension(extension);
        }