Skip to content

[Breaking change]: Removal of unused or unnecessary extension methods #24

@AndyButland

Description

@AndyButland

Description

This PR will remove some public extension methods from the Umbraco code base when Umbraco 17 is released.

When removed, clearly none will be used by Umbraco itself, but there may be some, though likely not many, implementations that have made use them. If that's the case, you'll get a compile error on upgrading to Umbraco 17.

Version

Umbraco 17

Previous behavior

Specific public extension methods are available (though obsoleted from 15.3).

New behavior

Specific public extension methods will not be available.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

To ease maintenance efforts we prefer to remove code that we are both no longer using in the product and that offer little value to implementors.

Recommended action

In the, likely rare, cases of using the extension methods, re-implement them within your own project. Some are rather legacy and as such there are better options available now in the C# language itself. If you want to retain them you of course are welcome to find them in the v15/dev branch of the Umbraco code base and copy them into your own solution.

Affected APIs

The following extension methods will be removed:

  • GetAssemblyFile available as an extension method of Assembly.
  • ToSingleItemCollection available as an extension method of ICollection.
  • All extension methods available on DataTable.
  • RetryUntilSuccessOrTimeout and RetryUntilSuccessOrMaxAttempts available as extension methods on delegates.
  • ToQueryString available as an extension method of IDictionary.
  • HasFlagAny available as an extension method on enums.
  • Expression extensions for boolean logic.
  • Deconstruct available as an extension method of KeyValuePair.
  • AsEnumerable, ContainsKey and GetValue available as extension methods on NameValueCollection.
  • SafeCast, ToDictionary and DisposeIfDisposable available as extension methods of object.
  • SanitizeThreadCulture available as an extension method of Thread.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions