How to tackle Slow INSERT for large amount of data in Entity Framework

NishaNinja
 
on Jul 25, 2014 05:44 AM
3578 Views

hi,

i'm using this code to update 10,000+ rows in entity framework. But it's taking more than 1 hour to compete transaction. Why it's taking too much time? Is there any solution of it?

 

     foreach (Property item in listProperties)
                    {
                        db.Properties.Attach(item);
                        db.Entry(item).Property(x => x.pState).IsModified = true;
                    }
                    db.SaveChanges();

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download