public NpgsqlRelationalConnection([NotNull] RelationalConnectionDependencies dependencies) : base(dependencies) { var npgsqlOptions = dependencies.ContextOptions.Extensions.OfType <NpgsqlOptionsExtension>().FirstOrDefault(); ProvideClientCertificatesCallback = npgsqlOptions.ProvideClientCertificatesCallback; RemoteCertificateValidationCallback = npgsqlOptions.RemoteCertificateValidationCallback; ProvidePasswordCallback = npgsqlOptions.ProvidePasswordCallback; }
/// <summary> /// Configures the <see cref="DbContext"/> to use the specified <see cref="ProvidePasswordCallback"/>. /// </summary> /// <param name="callback">The callback to use.</param> public virtual void ProvidePasswordCallback([CanBeNull] ProvidePasswordCallback callback) => WithOption(e => e.WithProvidePasswordCallback(callback));
/// <summary> /// Configures the <see cref="DbContext"/> to use the specified <see cref="ProvidePasswordCallback"/>. /// </summary> /// <param name="callback">The callback to use.</param> public virtual NpgsqlDbContextOptionsBuilder ProvidePasswordCallback( [CanBeNull] ProvidePasswordCallback callback) => WithOption(e => e.WithProvidePasswordCallback(callback));