TryDisposable 1.4.0

Wrap an object in a disposable decorator to attempt to dispose the object later. This is useful when retrieving an instance of an object from a factory or container while only having an interface reference. If the interface  does not implement IDisposable or IAsyncDisposable, but the concrete class does, this will allow you to dispose the instance without the need to check for the interface and cast it.

Install-Package TryDisposable -Version 1.4.0
dotnet add package TryDisposable --version 1.4.0
<PackageReference Include="TryDisposable" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TryDisposable --version 1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TryDisposable, 1.4.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install TryDisposable as a Cake Addin
#addin nuget:?package=TryDisposable&version=1.4.0

// Install TryDisposable as a Cake Tool
#tool nuget:?package=TryDisposable&version=1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETStandard 1.3

  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on TryDisposable:

Package Downloads
Diamond.Patterns.WorkFlow
This library provides work-flow interfaces and abstract or default implementations for common patterns.
Diamond.Patterns.Decorator
This library provides a basic implementation of the decorator factory.
Diamond.Patterns.StateDictionary
This library provides an implementation of the state dictionary and provides seveal default type converters.
Diamond.Patterns.Mvc
Provides the Do pattern execution for MVC projects.
Diamond.Core.WorkFlow.State
This library provides an implementation of the state dictionary and provides several default type converters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.4.0 251 12/3/2020
1.3.1 407 4/14/2020
1.3.0 576 1/25/2020
1.2.0 218 1/12/2020
1.1.0 205 1/12/2020
1.0.0 795 5/28/2019