I have read somewhere on this site or CodeProject that good rule is if some class has implemented IDisposable interface than and only than you should use using keyword because using keyword translated into MSIL is try/finally block something like this:
try
{
//some logic
}
finally
{
if (obj != null)
{
obj.Dispose();
}
}
but while watching tutorials for Entity Framework, I came across something like this:
using(SampleBEntities db = new SampleBEntities()){//some logic here}
and SampleBEntities inherits from ObjectContext and in the MSDN lib ObjectContext does not implement the IDisposable?
ObjectContext does not implement the IDisposable?