KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
We have a generic update method in our code that does a foreach (var entity in entityList) { Context.GetIDbSet<T>().Attach(entity); Context.SetState(entity, EntityState.Modified); } I'm testing this out by passing in an enumeration of entities and calling this once per entity. What I'm finding is that an enumeration of 1000 entities takes approximately 47s to run. Is that expected behavior? Or is there something wrong with the code snippet? Profiling showed the Attach() method was slower than the SetState() method. The test I ran it on was on an entity with 50 properties and no relations if that has any impact.
Tags (comma-separated)
Save Edits
Cancel