Example #1
0
        public NpgsqlRelationalConnection([NotNull] RelationalConnectionDependencies dependencies)
            : base(dependencies)
        {
            var npgsqlOptions =
                dependencies.ContextOptions.Extensions.OfType <NpgsqlOptionsExtension>().FirstOrDefault();

            ProvideClientCertificatesCallback   = npgsqlOptions.ProvideClientCertificatesCallback;
            RemoteCertificateValidationCallback = npgsqlOptions.RemoteCertificateValidationCallback;
            ProvidePasswordCallback             = npgsqlOptions.ProvidePasswordCallback;
        }
Example #2
0
 /// <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));
Example #3
0
 /// <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));