Skip to content

Restoration of Extension Methods #735

@jonsuda

Description

@jonsuda

My team has an existing project that uses a legacy version of UnitsNet (currently v3.102.0). We would like to upgrade to the latest version, but our code base relies heavily on the extension methods that were removed as part of the effort to cut down the size of the package (#372).

We understand the desire to keep the package small, which is why we’re not suggesting bringing the extension methods back into the main UnitsNet package. What we propose is creating another package, UnitsNet.Extensions (or something like that) specifically for these optional “convenience” pieces of functionality. (Bringing the extension methods back would be the first step; additional stuff might be added on a need-to-do basis in the future.)

As we need this functionality and will have to expend the effort to bring it back either way, we’d be more than happy to give back to the community by making our contribution open source (as opposed to simply doing it as our own project in our own private repository). We think it makes sense, however, for it to exist together with the rest of UnitsNet. In other words, we would like you to own it (even though we’re definitely open to making further contributions to it in the future).

Would you, in principle, be interested in such a contribution?

Here’s a summary of what we’re proposing:

  • We add another class library project, UnitsNet.Extensions (or similar), to the solution
  • We restore the code generator for the extension methods (convert it from PowerShell to C#)
  • We modify the build process to build and deploy an additional Nuget package, UnitsNet.Extensions; this package will have a dependency on the core UnitsNet package
  • Anyone interested in this auxiliary, “convenience” functionality can use this package, but it doesn’t affect the size of the core package
  • (We’ve already done much of this internally.)

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions