예제 #1
0
 public Statement GetStatement(string fullSqlId)
 {
     if (MappedStatement.ContainsKey(fullSqlId))
     {
         return(MappedStatement[fullSqlId]);
     }
     if (_logger.IsEnabled(LogLevel.Error))
     {
         _logger.LogError($"StatementMap could not find statement:{fullSqlId}");
     }
     throw new SmartSqlException($"StatementMap could not find statement:{fullSqlId}");
 }
예제 #2
0
 private void InitSqlMapStatementMap(SmartSqlMap sqlmap)
 {
     foreach (var statementKV in sqlmap.Statements)
     {
         var statement = statementKV.Value;
         if (MappedStatement.ContainsKey(statement.FullSqlId))
         {
             throw new SmartSqlException($"SmartSqlMapConfig Load MappedStatements: StatementId:{statement.FullSqlId}  already exists!");
         }
         MappedStatement.Add(statement.FullSqlId, statement);
     }
 }
예제 #3
0
 private void InitSqlMapStatementMap(SmartSqlMap sqlmap)
 {
     foreach (var statement in sqlmap.Statements)
     {
         if (MappedStatement.ContainsKey(statement.FullSqlId))
         {
             MappedStatement.Remove(statement.FullSqlId);
             if (_logger.IsEnabled(LogLevel.Warning))
             {
                 _logger.LogWarning($"SmartSqlMapConfig Load MappedStatements: StatementId:{statement.FullSqlId}  already exists!");
             }
         }
         MappedStatement.Add(statement.FullSqlId, statement);
     }
 }