aspnetcore/src/Mvc/shared/Mvc.Core.TestCommon
Pranav K cdae83efae
Use the declared type to infer NullableContextOptions (#15134)
* Use the declared type to infer NullableContextOptions

Prior to this change MVC used the runtime type rather than the declared type to
determine the nullability of a property based on state. In the case of inheritance,
this can be erroneous since the declared type may have a different nullability context
than the model type.

This change addresses this by adding content to `ModelIdentity` that allows inspecting the
declared type.

* Add an overload to `ModelMetadataIdentity` that allows flowing `PropertyInfo`
* Use the declared type in `DataAnnotationsMetadataProvider` to determine nullability based on context.

Fixes https://github.com/aspnet/AspNetCore/issues/14812
2019-10-20 06:30:58 -07:00
..
ActivityReplacer.cs
CommonFilterTest.cs
CommonResourceInvokerTest.cs
LinkBuilder.cs
MediaTypeAssert.cs
Microsoft.AspNetCore.Mvc.Core.TestCommon.csproj [release/3.1] Update dependencies from 2 repositories (#13571) 2019-09-15 21:27:50 -07:00
NonSeekableReadableStream.cs Avoid buffering during input formatting for longer than necessary (#9806) 2019-05-03 06:45:52 -07:00
RoutingResult.cs
SimpleValueProvider.cs
SimpleValueProviderFactory.cs
TestClientModelValidatorProvider.cs
TestHttpRequestStreamReaderFactory.cs
TestHttpResponseStreamWriterFactory.cs
TestModelBinderFactory.cs
TestModelMetadataProvider.cs Use the declared type to infer NullableContextOptions (#15134) 2019-10-20 06:30:58 -07:00
TestModelValidatorProvider.cs
ValidationAttributeUtil.cs