I have been doing research on Interfaces in C# for some time now,According to MSDN
"Interfaces are better suited to situations in which your applications require many possibly unrelated object types to provide certain functionality."
https://msdn.microsoft.com/en-in/library/3b5b8ezk(v=vs.90).aspx
When implementing Dispose() instead of using Interface IDisposable I can simply define 3 methods of Dispose() & give it to the user.My Question here is "Why has Microsoft created IDisposable interface and what is the purpose of using Interface to implement Dispose()".
This is what I meant
//This method is used to release Managed Resources.
public void Dispose()
{
this.Dispose();
}
//This method is used to release both managed & unmanaged Resources.
public void DisposeAll()
{
this.Dispose();
GC.SuppressFinalize(this);
ReleaseUnmangedResources();
}
//This method is used to release only unmanaged Resources.
public void DisposeUnmanaged()
{
ReleaseUnmangedResources();
}
I am sorry if this question is too stupid or simple.Please help me in understanding interfaces.