Reputation: 2478
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();
Upvotes: 1
Views: 76