This project has moved. For the latest updates, please go here.

How to use bulk insert

Apr 28, 2016 at 2:45 AM
I use this kind of code to fill the context:
DictWord w = new DictWord { WordID = WordID_counter, Word = "word1", WordStat = 20 };
context.DictWords.Add(w);
context.SaveChanges();

Now I want to use bulk insert instead of this, but I don't understand how to do it. I thought I should do something like:
List<DictWord> dw = new List<DictWord>();
DictWord w = new DictWord { WordID = WordID_counter, Word = "word1", WordStat = 20 };
dw.Add(w);
context.DictWords.BulkInsert(dw);

Please correct me.