Propagate PropertyInfo for AsParameters parameters by jgarciadelanoceda · Pull Request #57264 · dotnet/aspnetcore (original) (raw)
@jgarciadelanoceda Sorry for the delay...I needed a little bit of time to grok what you meant in your message.
This was my first thought indeed but the forParamater does not include the Container type (Because the ParameterInfo doesn't either)
The proposed change was for the else
case of the change where we try to generate ModelMetadata
for a parameter that doesn't have AsParameters
. It seems like not having the ContainerType
there is fine?
and also the logic in GetBindingSource and name gets other type that could be different from the type that the paramater has(for example when the type has a tryParse) and for compability issues I opted to just report the ParameterInfo
I see what you mean here. There is however an overload of ModelMetadataIdentity.ForParmaeter
that takes ParameterInfo
and Type
(ref). I think that should do the trick?