我希望通过Entity Framework在表中插入20000条记录,但需要2分钟左右。除了使用存储过程之外,是否有其他方法来提高性能?这是我的代码:
foreach (Employees item in sequence)
{
t = new Employees ();
t.Text = item.Text;
dataContext.Employees.AddObject(t);
}
dataContext.SaveChanges();