A default value supplies a value when an argument or route segment is omitted. In ASP.NET Core routing, a template such as {name=all} uses all when the URL omits name. section 6.0 section 6.3.2
Default values support two related forms:
- Route defaults match multiple URL shapes while producing the same route values; /product/shoes and /product/shoes/all both produce category=shoes and name=all. section 6.3.2
- Handler defaults supply a value when model binding cannot provide an argument, such as int id = 0 in a local endpoint function. section 7.5
- Keep optional route parameters at the end unless a default value supplies the omitted segment; an optional id cannot appear without category and name. section 6.3.2
Product route with a default
A route template containing /product/{category}/{name=all}/{id?} can match /product/shoes, /product/shoes/formal, and /product/shoes/formal/3. The first URL uses name=all; the last also captures id=3. section 6.3.2
Table 6.1 URLs that would match the template of figure 6.7 and their corresponding route values (view table figure)
Compare URLs with and without omitted segments and inspect the route values assigned to each. section 6.3.2



















