Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added order parameter to stepArgumentTransformation to prioritize execution #2753

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stbychkov
Copy link

What's changed

  • Added an optional Order parameter for StepArgumentTransformation to prioritize global type handlers effectively, ensuring they're considered last when needed.
  • Renamed StepTransformationTests file to StepArgumentTransformationTests as this change should've be done with this commit

In .NET 6 and earlier versions, the GetMethods method does not return methods in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which methods are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly.

(source)

Type.GetMethods is used to find all StepArgumentTransformation functions, but the order is not deterministic before .NET 7. This inconsistency made it tricky to handle type transformations, especially when setting up global handlers for optional parameters.

Types of changes

  • New feature (non-breaking change which adds functionality).
  • Other (docs, build config, etc)

Checklist:

  • I've added tests for my code. (most of the time mandatory)
  • I have added an entry to the changelog. (mandatory)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant