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); } }
public static void UseMySQL(this SqlBuilderOptions opts) { var extension = new MySqlBuilderExtension(); opts.RegisterExtension(extension); }