【发布时间】:2011-05-18 22:56:44
【问题描述】:
摘自 C# 驱动程序:
It is important that a cursor cleanly release any resources it holds. The key to guaranteeing this is to make sure the Dispose method of the enumerator is called. The foreach statement and the LINQ extension methods all guarantee that Dispose will be called. Only if you enumerate the cursor manually are you responsible for calling Dispose.
通过调用创建的光标“res”:
var res = images.Find(query).SetFields(fb).SetLimit(1);
没有Dispose 方法。我该如何处理它?
【问题讨论】:
标签: c# mongodb mongodb-.net-driver