Simple package to generate route builders using C# source generators.
The generator parses provided route pattern and generates method implementation that
- interpolates method parameters inside the template,
- serializes extra parameters as query arguments if provided (must be
nullif optional).
Each method can be configured to lowercase the route path and/or query strings, and append trailing slash to the path.
Generator handles parameter encoding, array parameters and optional route and query parameters.
Add a NuGet package reference to the project:<PackageReference Include="Ithline.Extensions.Http" Version="<version>" />
usingIthline.Extensions.Http;partialclassAppRoutes{[GeneratedRoute("/my-basic/{route:guid}")]publicstaticpartialstringMyBasicRoute(Guidroute,[QueryName("p")]int?page=null);}