【发布时间】:2012-10-15 22:01:20
【问题描述】:
我将 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
}
}
谢谢,
【问题讨论】:
标签: entity-framework ef-code-first entity-framework-migrations