Skip to content
Kirk Woll edited this page Apr 19, 2022 · 2 revisions

What's the point of this project?

The impetus for the creation of this project is that in both ASP.NET Web API and Blazor, you end up defining routes (or pages) with strings and then calling them also using strings. That sucks. The status quo is basically murdering DRY and putting it into its grave with as much thoroughness as possible.

So allow me to try to make this case. In Blazor you have pages defined like this:

@page "/path/to/my/page/{Id}/features"

The important part here is /path/to/my/page/{Id}/features. This is a standard route template. Why can't I use that to construct my URLs?

In Web API you have routes defined in a variety of ways, but they all boil down to the same problem: the strings you use to define your routes are divorced from where you call the endpoints. In both the minimal APIs and the more MVC flavored ones, you still end up defining your routes using attributes which generally precludes you from adding sufficient sophistication to actually reuse those values.

Clone this wiki locally