-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Introduce faster and richer way to add objects as query parameters #1974
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
Conversation
…ers when the type is known at compile time
…stRequestExtensions.AddObject
…ing unnecessary middle steps
…ns.AddObjectStatic
…target framework version
Thanks for the PR. Please remember to sign the CLA. |
Oops, my bad. Done. ✅ |
I'll look into what's happening with the test case that failed once I get home. |
The test case that was failing was one that I had in place to ensure that ref structs are not taken into consideration when turning an object into query parameters, since they cannot be boxed and will throw at runtime, which is what happens with the default I added a comment explaining the fix, but basically, I was filtering out properties based on whether they had a |
… properties correctly
…equestExtensions.PropertyCache.Populator.RequestProperty
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
I had to merge it manually, for some reason GitHub doesn't recognise it. |
Description
This PR is a result of the discussion in PR#1897. It introduces a new way of adding objects as query parameters to a RestRequest instance when the object type is known beforehand, which allows for a lot of optimizations to be made.
Apart from this, this PR also builds on top of pre-existing functionality, allowing for things like:
IEnumerable
types.IEnumerable
property.IConvertible
,IEnumerable
orIFormattable
, use the type's definedTypeConverter
and delegate conversion to string to it instead of using.ToString()
. This allows users to create custom converters to determine how certain types should be stringified. If no custom converter is defined, we will fall back to.ToString()
anyways.AddObject
implementation.Purpose
This pull request is a:
Checklist