示例#1
0
        public IdentityDbContext CreateContext(bool delete = false)
        {
            var db = DbUtil.Create <IdentityDbContext>(ConnectionString);

            if (delete)
            {
                db.Database.EnsureDeleted();
            }
            db.Database.EnsureCreated();
            return(db);
        }
        public void DropDb()
        {
            var db = DbUtil.Create <TestDbContext>(ConnectionString);

            db.Database.EnsureDeleted();
        }
示例#3
0
 public CustomDbContext <TKey> GetContext <TKey>() where TKey : IEquatable <TKey>
 {
     return(DbUtil.Create <CustomDbContext <TKey> >(ConnectionString));
 }