Do I need to force a Dispose after a LINQ query?
问题 My DBA says that there are way too many connection open and he thinks it is my code in .net that is leaving them open. I am using LINQ querys and EF code first. Example Method: public List<Stuff> GetStuff() { var db = new DBContext(); var results = db.stuff.toList(); return results; } Do I need to dispose the db var once I am done? My understanding is that I didn't need to in EF and LINQ. Please point me to a Microsoft documentation about managing connection in code or best practices for LINQ