❔ 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:But later it also says:Id
set to100
.
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
HTTP URLs are not case-sensitive, by definition
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...
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...
RouteOptions.LowercaseUrls Property (Microsoft.AspNetCore.Routing)
Gets or sets a value indicating whether all generated paths URLs are lowercase. Use LowercaseQueryStrings to configure the behavior for query strings.
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.