The code looks like this.
public class clsMisc : IDisposable {
List<clsEmployee> lst = new List<clsEmployee>();
void Add(){
lst.Add(obj);
//Adding to it list here
}
public void Dispose()
{
lst = null;
}
}
The above class is called like this,
Using( clsMisc obj = new clsMisc()){
//Here goes the code
}
once it comes out of the using scope, the dispose method in the clsMisc s called and in that we assigned null.
Will the values stored in memory ( existing records of clsEmployee in the list) will be released and it will assign new value or it will create a new instance of List and assign the null value ?
I couldn't understand the behaviour since i am very new.
Can someone please guide me in this ?