using Npgsql;

namespace ProviderApp
{
    public static class DBConnection
    {
        private const string Host = "edu-pg.itiscaf.ru";
        private const int Port = 5432;
        private const string Database = "dbwork";
        private const string Username = "sizov_ev";
        private const string Password = "#%e6&R0v&%&";

        // Вариант 1: Просто отключить SSL
        public static string ConnectionString =>
            $"Host={Host};Port={Port};Database={Database};Username={Username};Password={Password};SSL Mode=Disable;";
        public static NpgsqlConnection GetConnection()
        {
            NpgsqlConnection conn = new NpgsqlConnection(ConnectionString);
            conn.Open();
            return conn;
        }
    }
}