/// <summary> /// 实例化Oracle选项扩展 /// </summary> /// <param name="copyFrom"></param> /// <param name="logger"></param> protected OracleOptionsExtension( [NotNull] OracleOptionsExtension copyFrom, IDiagnosticsLogger <DbLoggerCategory.Infrastructure> logger = null) : base(copyFrom) { if (Check.IsTraceEnabled(logger?.Logger)) { Trace <DbLoggerCategory.Infrastructure> .Write(logger, LogLevel.Trace, OracleTraceTag.Entry, OracleTraceClassName.OracleOptionsExtensions, OracleTraceFuncName.ctor); } Check.NotNull(copyFrom, nameof(copyFrom)); m_oracleLogger = logger; _oracleSQLCompatibility = copyFrom._oracleSQLCompatibility; if (Check.IsTraceEnabled(logger?.Logger)) { Trace <DbLoggerCategory.Infrastructure> .Write(logger, LogLevel.Trace, OracleTraceTag.Exit, OracleTraceClassName.OracleOptionsExtensions, OracleTraceFuncName.ctor); } }
/// <summary> /// 使用兼容OracleSQL /// </summary> /// <param name="oracleSQLCompatibility">使用兼容OracleSQL。"11"表示11.2G及以前的数据库, "12"表示12c及以后的数据库</param> /// <returns></returns> public virtual OracleOptionsExtension WithOracleSQLCompatibility(string oracleSQLCompatibility) { if (Check.IsTraceEnabled(m_oracleLogger?.Logger)) { Trace <DbLoggerCategory.Infrastructure> .Write(m_oracleLogger, LogLevel.Trace, OracleTraceTag.Entry, OracleTraceClassName.OracleOptionsExtensions, OracleTraceFuncName.WithOracleSQLCompatibility); } OracleOptionsExtension oracleOptionsExtension = (OracleOptionsExtension)Clone(); oracleOptionsExtension._oracleSQLCompatibility = oracleSQLCompatibility; if (Check.IsTraceEnabled(m_oracleLogger?.Logger)) { Trace <DbLoggerCategory.Infrastructure> .Write(m_oracleLogger, LogLevel.Trace, OracleTraceTag.Map, OracleTraceClassName.OracleOptionsExtensions, OracleTraceFuncName.WithOracleSQLCompatibility, "OracleSQLCompatibility: " + oracleSQLCompatibility); } if (Check.IsTraceEnabled(m_oracleLogger?.Logger)) { Trace <DbLoggerCategory.Infrastructure> .Write(m_oracleLogger, LogLevel.Trace, OracleTraceTag.Exit, OracleTraceClassName.OracleOptionsExtensions, OracleTraceFuncName.WithOracleSQLCompatibility); } return(oracleOptionsExtension); }