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

URI extension method to add parameters #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jtorreguitar
Copy link
Contributor

@jtorreguitar jtorreguitar commented Jan 21, 2019

Summary:

Adding a parameter to a uri using the existing URI class is verbose and long-winded. A new class was added that provides and extension method for adding these parameters in a simple way. Note that it will throw an exception if used with relative uris as it uses the URIBuilder class which does not support this type of uri.

Sample usage:

URI uri = new URI(Client.BaseAddress + ControllerBaseURL)
            .AddParameter("categoryId", "0")
            .AddParameter("ageRangeId", "0")
            .AddParameter("pageSize", $"{count}");

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