You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially if a class correctly implements the IDisposable pattern, then public/internal/protected methods should throw ObjectDisposedException(this.GetType().FullName) as per the majority of .NET framework classes (e.g. Socket).
if (this.disposed)
{
throw new ObjectDisposedException(this.GetType().FullName);
}
Optionally an XML comment should be declared to reflect this:
/// <exception cref="ObjectDisposedException">Thrown if this instance of <see cref="ClassName" /> has been disposed.</exception>
The text was updated successfully, but these errors were encountered:
Linked in dotnet/roslyn-analyzers#293.
Essentially if a class correctly implements the IDisposable pattern, then public/internal/protected methods should throw ObjectDisposedException(this.GetType().FullName) as per the majority of .NET framework classes (e.g. Socket).
Optionally an XML comment should be declared to reflect this:
The text was updated successfully, but these errors were encountered: