68bf719c27028ec0fd9d541ba3dfdbb96c2dc76d
UriBuilder.Fluent
This places extension methods over System.UriBuilder to help deal with query string parameters, and create more of a fluent interface. Unlike other projects, this NetStandardLibrary compliant package builds ontop of trusty UriBuilder, does not use custom Uri generators, or have outside dependencies. Unit tests continue to be a first class citizen!
This lets you do things like
new UriBuilder()
.WithParameter("awesome", "yodawg")
.WithParameter("fun", ["cool", "yay"])
.WithHost("awesome.com")
.WithPathSegment("seg")
.UseHttps()
.ToString()
result: https://awesome.com/seg?awesome=yodawg&fun=cool,yay
or
new UriBuilder("https://awesome.com/yo)
.WithParameter("id", "5")
.ToString();
result: https://awesome.com/yo?id=5
you can even pass a dictionary of parameters
var dictionary = new Dictionary<string, string>()
{
["yo"] = "dawg"
};
new UriBuilder("http://awesome.com")
.WithParameter(dictionary);
http://awesome.com/?yo=dawg
Getting started
Just install the nuget package install-package UriBuilder.Fluent and thats it. The extension methods should be available to you!
Languages
C#
96.5%
Makefile
3.5%