コード例 #1
0
        public void Inistall()
        {
            MyDbFactory  = GetFactory();
            MyConnection = MyDbFactory.CreateConnection();
            var myConnection = MyConnection;

            if (myConnection == null)
            {
                return;
            }
            myConnection.ConnectionString = CurConStr;
            AppCons.Connection            = MyConnection;
        }
コード例 #2
0
 public override DbConnection CreateConnection()
 {
     if (MyConnection != null)
     {
         DbConnection connect = base.MyConnection;
         return(connect);
     }
     else
     {
         DbConnection connect = MyDbFactory.CreateConnection();
         connect.ConnectionString = CurConStr;
         return(connect);
     }
 }
コード例 #3
0
 public Startup(IConfiguration configuration)
 {
     Configuration = configuration;
     MyDbFactory.Setup(Configuration["MySqlConnectionString"], Configuration["SqlConnectionString"]);
 }