Beispiel #1
0
        public override void CreateConnection(string options)
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseSqlite(options);
            Db = new DbDataContext(optionsBuilder.Options);
        }
Beispiel #2
0
        public override void CreateConnection(string options)
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseMySql(options);
            Db = new DbDataContext(optionsBuilder.Options);
            Db.Database.EnsureCreated();

            Db.Database.OpenConnection();
        }
 public virtual void CloseConnection()
 {
     Db?.Dispose();
     Db = null;
 }