C
C#15mo ago
palapapa

❔ Inconsistency in the documentation of model binding for complex types?

In https://learn.microsoft.com/en-us/aspnet/core/mvc/models/model-binding?view=aspnetcore-7.0#complex-types, it says:
For example, with a query containing ?Instructor.Id=100&Name=foo, bound to method OnGet(Instructor instructor), the resulting object of type Instructor contains: Id set to 100.
But later it also says:
For binding to a parameter, the prefix is the parameter name.
Don't these two contradict each other? If the second sentense were true, then Id wouldn't have been bound because the prefix should have been instructor not Instructor.
Model Binding in ASP.NET Core
Learn how model binding in ASP.NET Core works and how to customize its behavior.
5 Replies
JakenVeina
JakenVeina15mo ago
HTTP URLs are not case-sensitive, by definition
palapapa
palapapaOP15mo ago
https://webmasters.stackexchange.com/questions/90339/why-are-urls-case-sensitive Here it says the query string is case sensitive though
Webmasters Stack Exchange
Why are URLs case-sensitive?
My question: When URLs were first designed, why was case-sensitivity made a feature? I ask this because it seems to me (i.e., a layperson) that case-insensitivity would be preferred to prevent need...
JakenVeina
JakenVeina15mo ago
I stand corrected every webserver framework I've ever used implements case-insensitive routing policies, so I didn't even realize im the case of ASP.NET Core...
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server