是否可以使用codefirst迁移在一个DAL中创建/连接多个数据库?
例如:
namespace School.DAL.DbContexts
{
public class RoomDBContext: DbContext
{
public RoomDBContext() : base("RoomConnString") { }
public DbSet<Teacher> Teachers { get; set; }
public DbSet<Student> Students { get; set; }
}
}
namespace School.DAL.DbContexts
{
public class BookDBContext: DbContext
{
public BookDBContext() : base("BookConnString") { }
public DbSet<Book> Books { get; set; }
public DbSet<Category> Categories { get; set; }
}
}