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(); }
public CustomDbContext <TKey> GetContext <TKey>() where TKey : IEquatable <TKey> { return(DbUtil.Create <CustomDbContext <TKey> >(ConnectionString)); }