How to prevent memory overflow when using an IEnumerable and Linq-To-Sql?

后端 未结 4 711
旧时难觅i
旧时难觅i 2021-01-16 02:53

This question is related to a previous question of mine

That\'s my current code

 IEnumerable Get()
 {
     while(//get implementation
           


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-01-16 03:47

    One option is to break it up into multiple batches. Create a temporary buffer of Shape objects, iterate until you fill it or run out from the enumerator, then do a InsertBatchOnSubmit.

提交回复
热议问题