I have two classes, for example class MyFirstClassand MyAnotherClass, MyAnotherClassimplements the IDiposable interface.
public class MyFirstClass
{
public string xyz{get;set;} ..... and so on
}
public class MyAnotherClass : IDisposable
{
private readonly MyFirstClass objFc = new MyFirstClass();
public static void MyStaticMethod()
{
var objOfFirstClass = new MyFirstClass();
}
public void MyNonStaticMethod()
{
}
#region Implementation of IDisposable
.... my implementations
#endregion
}
Now I have another class where I call MyAnotherClass, something like this
using(var anotherObj = new MyAnotherClass())
{
}
So, I would like to know if I should worry about a script to clean my objects? Also, what will happen to mine ObjFC(inside non-static) and objOfFirstClass(inside static).
AFAIK using will take care of everything ... but I need to know more ...
source
share