locked
Which .NET classes implements IDisposable RRS feed

  • Question

  • Hi All,

    Which .NET classes  implement IDisposable?

    Thanks in advance.

    Thursday, April 23, 2020 1:39 PM

Answers

  • Take a look at the following

    https://stackoverflow.com/questions/6034728/which-net-framework-classes-implement-idisposable

    Then this from here

    IEnumerable<Type> disposableTypes =
        from assm in AppDomain.CurrentDomain.GetAssemblies()
        from type in assm.GetTypes()
        where typeof(IDisposable).IsAssignableFrom(type)
        select type;
    
    foreach (var itemDisposableType in disposableTypes)
    {
        Console.WriteLine(itemDisposableType.Name);
    }


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, April 23, 2020 1:54 PM

All replies