Skip to content
Loading
0
  • Laxmidhar Sahoo
    0
    Hi
     
    In foreach loop each time you call savechanges() method .
     
    You can apply bulkInsert method or after addrange use savechanges()
    1. List emps = new List();  
    2. foreach()  
    3. {  
    4. EmpScheduleMaster objempM = new EmpScheduleMaster();  
    5. .  
    6. .  
    7. emps.add(objempM)  
    8. }  
    9. _DB..BulkInsert(emps);  
    For more follow the link
    https://entityframework-extensions.net/bulk-insert
    https://weblog.west-wind.com/posts/2013/Dec/22/Entity-Framework-and-slow-bulk-INSERTs
    0