我很想知道是否可以将这两个下面的类合并为一个单独的类。
第一个DbContext:
static void submit() {
Dimension screen = mobileDriver.manage().window().getSize();
mobileDriver.tap(1, screen.getWidth() - 20, screen.getHeight() - 20);
}
第二个DbContext:
public class ApplicationDbContext : IdentityDbContext<BusinessAccount>
{
public ApplicationDbContext()
: base("MySQLConnectionString", throwIfV1Schema: false)
{
}
public DbSet<Sector> Sectors { get; set; }
public DbSet<Campus> Campuss { get; set; }
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
}
答案 0 :(得分:0)
从DbContext继承IdentityDbContext
public class IdentityDbContext<T1>: DbContext
{
// Implementation goes here
}
从ApplicationDbContext
IdentityDbContext<BusinessAccount>
public class ApplicationDbContext : IdentityDbContext<BusinessAccount>
{
public ApplicationDbContext()
: base("MySQLConnectionString", throwIfV1Schema: false)
{
}
public DbSet<Sector> Sectors { get; set; }
public DbSet<Campus> Campuss { get; set; }
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
}