Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "andonisan"

Question

Hello,

First thank you for your great work .

I have a doubt about which is the best way to bulk insert with the repository pattern, because when i have to insert 500 rows it takes a lot of time.

I have tried disabling AutoDetectChangesEnabled but the performance still very bad

Maybe IRepository colud be extended to insertRange for this kind of insertions?

using (var unitOfWork = _unitOfWorkManager.Begin())
                  {

                      Context.Configuration.AutoDetectChangesEnabled = false;
                      foreach (var element in list)
                      {
                          Insert(element);
                      }

                      Context.Configuration.AutoDetectChangesEnabled = true;

                      unitOfWork.Complete();
                  }
Showing 1 to 1 of 1 entries