1

My simple usecase is changing page number. Like: http://localhost?page=1 to: http://localhost?page=2

I would like to be able to add/update/remove segments from querystring.

There are QueryString and QueryBuilder classes, however they support only adding segments, not changing them. WebUtilities.QueryHelpers parses querystring to dictionary, but that is hard to edit, because you need to create variable, and also you need to check if key exists.

My frontend engineers need simple and foolproof way of manipulating it, to use with server generated url or IUrlHelper. Is there builtin way of doing it?

My ideal api:

Query(Model.Uri).Update('page', '2').Add('sort', 'asc').Remove('filter').ToString();

1 Answer 1

3

Try Flurl, it is the perfect tool for what your need ;)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.