How to create a DbSet with a list of entities

.net entity-framework

Question

DbSet. One Entity is added to DbSet by using Add(). However, DbSet is absent. To add a list of entities, use AddRange(). Is there a mechanism I can use to add a list of Entities straight from EF? If not, is there a justification for EF not offering such a method?

1
8
2/12/2012 1:49:32 AM

Popular Answer

Both are EF6.DbSet.AddRange and DbSet.RemoveRange are accessible.

The goal of its implementation is to increase performance, which is accomplished by blockingDetectChanges for each unique entity that is added or removed.

More information

Because EF is currently in RC1, there is no current official documentation for this approach.

UPDATE: EF6 and The official.AddRange() documentation may be found here. have been released, but the details of what's going on within may be found in the URLs above.

11
3/13/2014 11:22:54 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow