Пример #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="runtime">Dapper运行时</param>
 /// <param name="loggerFactory">日志工厂</param>
 public DapperContext(DapperRuntime runtime, ILoggerFactory loggerFactory)
 {
     Runtime        = runtime;
     _loggerFactory = loggerFactory;
     _loggerLazy    = new Lazy <ILogger>(() => loggerFactory?.CreateLogger <DapperContext>() ?? NullLogger <DapperContext> .Instance);
     _connections   = new ConcurrentDictionary <string, DbConnection>();
 }
Пример #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="runtime"></param>
        public DapperSqlGenerator(DapperRuntime runtime)
        {
            Guard.ArgumentNotNull(runtime, nameof(runtime));

            _runtime = runtime;
        }