我将 EF5 与 MVC4 一起使用。问题是我的数据库中有大量数据,这些数据已经从旧数据库导入。我想在模型更改时加载该数据的种子。我的问题是如何播种数据库中已经存在的大量数据?
internal sealed class Configuration : MigrationsConfiguration<VoiceLab.Models.EFDataContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
}
protected override void Seed(VoiceLab.Models.EFDataContext context)
{
//what to do here to seed thousands or records that are already in db
}
}
谢谢,