示例#1
0
        public SmartSqlMapper(SmartSqlOptions options)
        {
            SmartSqlOptions = options;
            SmartSqlOptions.Setup();
            _logger = LoggerFactory.CreateLogger <SmartSqlMapper>();
            _dataReaderDeserializer = DeserializerFactory.Create();
            NestedObjectConvertFactory convertFactory = new NestedObjectConvertFactory();

            _nestedObjectConverter = new NestedObjectConverter(convertFactory);
        }
示例#2
0
 public ISmartSqlMapper GetSqlMapper(SmartSqlOptions smartSqlOptions)
 {
     if (!_mapperContainer.ContainsKey(smartSqlOptions.ConfigPath))
     {
         lock (syncRoot)
         {
             if (!_mapperContainer.ContainsKey(smartSqlOptions.ConfigPath))
             {
                 ISmartSqlMapper _mapper = new SmartSqlMapper(smartSqlOptions);
                 _mapperContainer.Add(smartSqlOptions.ConfigPath, _mapper);
             }
         }
     }
     return(_mapperContainer[smartSqlOptions.ConfigPath]);
 }
示例#3
0
 public ISmartSqlMapper GetSqlMapper(SmartSqlOptions smartSqlOptions)
 {
     if (String.IsNullOrEmpty(smartSqlOptions.Alias))
     {
         smartSqlOptions.Alias = smartSqlOptions.ConfigPath;
     }
     if (!_mapperContainer.ContainsKey(smartSqlOptions.Alias))
     {
         lock (this)
         {
             if (!_mapperContainer.ContainsKey(smartSqlOptions.Alias))
             {
                 ISmartSqlMapper _mapper = new SmartSqlMapper(smartSqlOptions);
                 _mapperContainer.Add(smartSqlOptions.Alias, _mapper);
             }
         }
     }
     return(_mapperContainer[smartSqlOptions.Alias]);
 }
示例#4
0
 public SmartSqlMapper(SmartSqlOptions options)
 {
     _smartSqlOptions = options;
     _smartSqlOptions.Setup();
     _logger = LoggerFactory.CreateLogger <SmartSqlMapper>();
 }