public static void UseSmartSql(this IServiceCollection services, Action <SmartSqlOptions> optionAction)
        {
            var options = new SmartSqlOptions();

            optionAction(options);

            services.AddSingleton(sp =>
            {
                var loggerFactory = sp.GetRequiredService <ILoggerFactory>();
                return(MapperContainer.Instance.GetSqlMapper(loggerFactory, string.Empty, new NativeConfigLoader(loggerFactory, options)));
            });
        }
Esempio n. 2
0
 public NativeConfigLoader(ILoggerFactory loggerFactory, SmartSqlOptions options)
 {
     _logger          = loggerFactory.CreateLogger(GetType());
     _smartSqlOptions = options;
 }