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}"); }
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); } }
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); } }