My application uses one context instance which exists for the life of the application. I am using Entity Framework to read and write all data to the database. After I add objects, I want them to be cleaned by the garbage collector so they don't persist in memory. I've tried:
While context.BatchProgresses.Count > 0
context.Detach(context.BatchProgresses.First())
End While
but this is an infinite loop when run. What gives? Shouldn't Context.Detach remove items from Context.BatchProgresses?