Skip to content

v3.6.6

Compare
Choose a tag to compare
@Ahoo-Wang Ahoo-Wang released this 04 Sep 08:32
· 503 commits to master since this release
  1. fixed ObjectUtils key conflicts
  2. add support for SmartSqlMapper multiple instance injection
  3. add support for IServiceProvider.GetSmartSqlMapper(string configPath)
      var smartSqlMapper = serviceProvider.GetSmartSqlMapper("SmartSql");
      var smartSqlMapper_1 = serviceProvider.GetSmartSqlMapper("SmartSql-1");
  1. optimize Options DI for SmartSqlOptions.UseOptions
            var builder = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                 .AddJsonFile("SmartSqlConfig.json", false, true);

            var configuration = builder.Build();
            var services = new ServiceCollection();

            services.AddOptions();
            var smartSqlConfigJson = configuration.GetSection("SmartSqlConfig");
            services.Configure<SmartSqlConfigOptions>("SmartSql", smartSqlConfigJson);

            services.AddSmartSql(sp =>
            {
                return new SmartSqlOptions
                {
                     ConfigPath= "SmartSql"
                }.UseOptions(sp);
            });