コード例 #1
0
        public static bool GetFinalParameterEnable(PostgresEnricherOptions options, PostgresEnricherConfiguration configuration)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (configuration is null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (options.IsParameterLoggingEnable.HasValue)
            {
                return(options.IsParameterLoggingEnable.Value);
            }

            if (configuration.IsParameterLoggingEnable.HasValue)
            {
                return(configuration.IsParameterLoggingEnable.Value);
            }

            return(false);
        }
コード例 #2
0
 /// <inheritdoc />
 public NpgsqlLogActivation(ILoggingServiceProvider loggingServiceProvider, IOptions <PostgresEnricherOptions> settings)
 {
     _loggingServiceProvider = loggingServiceProvider ?? throw new ArgumentNullException(nameof(loggingServiceProvider));
     _options = settings?.Value ?? throw new ArgumentNullException(nameof(settings));
 }