quicktype generates types and helper code for reading JSON in C#, Swift, TypeScript, Go, Objective-C, C++ and more. Customize online with advanced options, or download a command-line tool. VSCode Plugin
A URI building helper library for ASP.NET Web API
Example
Imagine that you're using the standard route configuration created by the Visual Studio project template:
name: "API Default", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }
In that case, you can create an URI to a the resource handled by the FooController.GetById Action Method like this:
var uri = linker.GetUri<FooController>(r => r.GetById(1337));
This will create a URI like this:
http://localhost/api/foo/1337
Drum is a little library for building URIs to ASP.NET Web API actions, using direct routes and lambda expressions. It provides an alternative to the UrlHelper class. Instead of requiring a route name and a set of name-value pairs, Drum allows the creation of URIs using actions invocations.
// using UrlHelper var uri1 = _urlHelper.Link("GetPaged", new { page = 0, count = 10 }); // using UriMaker var uri2 = _uriMaker.UriFor(c => c.GetPaged(0, 10));
where GetPaged
is a Web API controller action
[RoutePrefix("api/UriMakerTests/resources")] public class ResourceController : ApiController { [Route("", Name="GetPaged")] public HttpResponseMessage GetPaged(int page, int count) {...} ... }