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

Activities of "andonisan"

Answer

Hi,

You´re right about adding a bulk insert method only disabling autodetectchanges.

i added to my project other open source project

<a class="postlink" href="https://efbulkinsert.codeplex.com/">https://efbulkinsert.codeplex.com/</a>

Now the performance is awesome for bulk inserting,

this example is in my EnityFramework project Repositories

public  Task SetList(List<Entity> input)
        {
           

            return Task.Run(() =>
              {
                  using (var transactionScope = new TransactionScope())
                  {

                      Context.BulkInsert(input);
                      Context.SaveChanges();
                      transactionScope.Complete();

                  }
              }
            );
        }

Thanks a lot

Showing 1 to 1 of 1 entries