This question is related to a previous question of mine
That's my current code
IEnumerable<Shape> Get()
{
while(//get implementation
yield return new Shape(//...
}
void Insert()
{
var actual = Get();
using (var db = new DataClassesDataContext())
{
db.Shapes.InsertAllOnSubmit(actual);
db.SubmitChanges();
}
}
I'm getting a memory overflow, since the IEnumerable is too big. How do I prevent it?