Merge remote-tracking branch 'origin/release/2.1' into dev
This commit is contained in:
commit
9875fffc80
|
|
@ -1,5 +1,6 @@
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">$(MicrosoftNETCoreApp21PackageVersion)</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">$(MicrosoftNETCoreApp21PackageVersion)</RuntimeFrameworkVersion>
|
||||||
|
<NETStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard2.0' ">$(NETStandardLibrary20PackageVersion)</NETStandardImplicitPackageVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -5,87 +5,88 @@
|
||||||
<PropertyGroup Label="Package Versions">
|
<PropertyGroup Label="Package Versions">
|
||||||
<AngleSharpPackageVersion>0.9.9</AngleSharpPackageVersion>
|
<AngleSharpPackageVersion>0.9.9</AngleSharpPackageVersion>
|
||||||
<BenchmarkDotNetPackageVersion>0.10.13</BenchmarkDotNetPackageVersion>
|
<BenchmarkDotNetPackageVersion>0.10.13</BenchmarkDotNetPackageVersion>
|
||||||
<InternalAspNetCoreSdkPackageVersion>2.1.0-preview3-17032</InternalAspNetCoreSdkPackageVersion>
|
<InternalAspNetCoreSdkPackageVersion>2.1.0-rc1-15774</InternalAspNetCoreSdkPackageVersion>
|
||||||
<MicrosoftAspNetCoreAntiforgeryPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreAntiforgeryPackageVersion>
|
<MicrosoftAspNetCoreAntiforgeryPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreAntiforgeryPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationCorePackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreAuthenticationCorePackageVersion>
|
<MicrosoftAspNetCoreAuthenticationCorePackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreAuthenticationCorePackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreAuthenticationPackageVersion>
|
<MicrosoftAspNetCoreAuthenticationPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreAuthenticationPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>
|
<MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>
|
||||||
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
|
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>
|
<MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreCookiePolicyPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreCookiePolicyPackageVersion>
|
<MicrosoftAspNetCoreCookiePolicyPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreCookiePolicyPackageVersion>
|
||||||
<MicrosoftAspNetCoreCorsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreCorsPackageVersion>
|
<MicrosoftAspNetCoreCorsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreCorsPackageVersion>
|
||||||
<MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreDiagnosticsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreDiagnosticsPackageVersion>
|
<MicrosoftAspNetCoreDiagnosticsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreDiagnosticsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreHostingPackageVersion>
|
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreHostingPackageVersion>
|
||||||
<MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHttpExtensionsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreHttpExtensionsPackageVersion>
|
<MicrosoftAspNetCoreHttpExtensionsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreHttpExtensionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHttpPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreHttpPackageVersion>
|
<MicrosoftAspNetCoreHttpPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreHttpPackageVersion>
|
||||||
<MicrosoftAspNetCoreJsonPatchPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreJsonPatchPackageVersion>
|
<MicrosoftAspNetCoreJsonPatchPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreJsonPatchPackageVersion>
|
||||||
<MicrosoftAspNetCoreLocalizationPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreLocalizationPackageVersion>
|
<MicrosoftAspNetCoreLocalizationPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreLocalizationPackageVersion>
|
||||||
<MicrosoftAspNetCoreLocalizationRoutingPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreLocalizationRoutingPackageVersion>
|
<MicrosoftAspNetCoreLocalizationRoutingPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreLocalizationRoutingPackageVersion>
|
||||||
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
|
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>
|
<MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorDesignPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreRazorDesignPackageVersion>
|
<MicrosoftAspNetCoreRazorDesignPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreRazorDesignPackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorLanguagePackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreRazorLanguagePackageVersion>
|
<MicrosoftAspNetCoreRazorLanguagePackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreRazorLanguagePackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreRazorRuntimePackageVersion>
|
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreRazorRuntimePackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>
|
<MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreResponseCachingPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreResponseCachingPackageVersion>
|
<MicrosoftAspNetCoreResponseCachingPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreResponseCachingPackageVersion>
|
||||||
<MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreRoutingPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreRoutingPackageVersion>
|
<MicrosoftAspNetCoreRoutingPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreRoutingPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||||
<MicrosoftAspNetCoreSessionPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreSessionPackageVersion>
|
<MicrosoftAspNetCoreSessionPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreSessionPackageVersion>
|
||||||
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
||||||
<MicrosoftAspNetCoreTestHostPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreTestHostPackageVersion>
|
<MicrosoftAspNetCoreTestHostPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreTestHostPackageVersion>
|
||||||
<MicrosoftAspNetCoreTestingPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreTestingPackageVersion>
|
<MicrosoftAspNetCoreTestingPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreTestingPackageVersion>
|
||||||
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.1.0-preview3-32233</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.1.0-rc1-30613</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
||||||
<MicrosoftAspNetWebApiClientPackageVersion>5.2.4</MicrosoftAspNetWebApiClientPackageVersion>
|
<MicrosoftAspNetWebApiClientPackageVersion>5.2.4</MicrosoftAspNetWebApiClientPackageVersion>
|
||||||
<MicrosoftCodeAnalysisCSharpPackageVersion>2.6.1</MicrosoftCodeAnalysisCSharpPackageVersion>
|
<MicrosoftCodeAnalysisCSharpPackageVersion>2.8.0-beta3</MicrosoftCodeAnalysisCSharpPackageVersion>
|
||||||
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>2.6.1</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
|
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>2.8.0-beta3</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
|
||||||
<MicrosoftCodeAnalysisRazorPackageVersion>2.1.0-preview3-32233</MicrosoftCodeAnalysisRazorPackageVersion>
|
<MicrosoftCodeAnalysisRazorPackageVersion>2.1.0-rc1-30613</MicrosoftCodeAnalysisRazorPackageVersion>
|
||||||
<MicrosoftDiaSymReaderNativePackageVersion>1.7.0</MicrosoftDiaSymReaderNativePackageVersion>
|
<MicrosoftDiaSymReaderNativePackageVersion>1.7.0</MicrosoftDiaSymReaderNativePackageVersion>
|
||||||
<MicrosoftExtensionsCachingMemoryPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsCachingMemoryPackageVersion>
|
<MicrosoftExtensionsCachingMemoryPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsCachingMemoryPackageVersion>
|
||||||
<MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>
|
<MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsConfigurationPackageVersion>
|
<MicrosoftExtensionsConfigurationPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsConfigurationPackageVersion>
|
||||||
<MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>
|
<MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>
|
||||||
<MicrosoftExtensionsDependencyInjectionPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
<MicrosoftExtensionsDependencyInjectionPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
||||||
<MicrosoftExtensionsDependencyModelPackageVersion>2.1.0-preview3-26413-05</MicrosoftExtensionsDependencyModelPackageVersion>
|
<MicrosoftExtensionsDependencyModelPackageVersion>2.1.0-rc1-26419-02</MicrosoftExtensionsDependencyModelPackageVersion>
|
||||||
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
||||||
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
|
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
|
||||||
<MicrosoftExtensionsFileProvidersCompositePackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsFileProvidersCompositePackageVersion>
|
<MicrosoftExtensionsFileProvidersCompositePackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsFileProvidersCompositePackageVersion>
|
||||||
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
||||||
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
|
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
|
||||||
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
|
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsLocalizationPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsLocalizationPackageVersion>
|
<MicrosoftExtensionsLocalizationPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsLocalizationPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
|
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsLoggingConsolePackageVersion>
|
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||||
<MicrosoftExtensionsLoggingDebugPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsLoggingDebugPackageVersion>
|
<MicrosoftExtensionsLoggingDebugPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsLoggingDebugPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsLoggingPackageVersion>
|
<MicrosoftExtensionsLoggingPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsLoggingPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsLoggingTestingPackageVersion>
|
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||||
<MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>
|
<MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsOptionsPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsOptionsPackageVersion>
|
<MicrosoftExtensionsOptionsPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsOptionsPackageVersion>
|
||||||
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
|
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsPrimitivesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsPrimitivesPackageVersion>
|
<MicrosoftExtensionsPrimitivesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsPrimitivesPackageVersion>
|
||||||
<MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>
|
<MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsPropertyHelperSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsPropertyHelperSourcesPackageVersion>
|
<MicrosoftExtensionsPropertyHelperSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsPropertyHelperSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsSecurityHelperSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsSecurityHelperSourcesPackageVersion>
|
<MicrosoftExtensionsSecurityHelperSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsSecurityHelperSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
|
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
|
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsWebEncodersPackageVersion>2.1.0-preview3-32233</MicrosoftExtensionsWebEncodersPackageVersion>
|
<MicrosoftExtensionsWebEncodersPackageVersion>2.1.0-rc1-30613</MicrosoftExtensionsWebEncodersPackageVersion>
|
||||||
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
||||||
<MicrosoftNETCoreApp21PackageVersion>2.1.0-preview3-26413-05</MicrosoftNETCoreApp21PackageVersion>
|
<MicrosoftNETCoreApp21PackageVersion>2.1.0-rc1-26419-02</MicrosoftNETCoreApp21PackageVersion>
|
||||||
<MicrosoftNetHttpHeadersPackageVersion>2.1.0-preview3-32233</MicrosoftNetHttpHeadersPackageVersion>
|
<MicrosoftNetHttpHeadersPackageVersion>2.1.0-rc1-30613</MicrosoftNetHttpHeadersPackageVersion>
|
||||||
<MicrosoftNETSdkRazorPackageVersion>2.1.0-preview3-32233</MicrosoftNETSdkRazorPackageVersion>
|
<MicrosoftNETSdkRazorPackageVersion>2.1.0-rc1-30613</MicrosoftNETSdkRazorPackageVersion>
|
||||||
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
|
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
|
||||||
<MoqPackageVersion>4.7.49</MoqPackageVersion>
|
<MoqPackageVersion>4.7.49</MoqPackageVersion>
|
||||||
|
<NETStandardLibrary20PackageVersion>2.0.1</NETStandardLibrary20PackageVersion>
|
||||||
<NewtonsoftJsonBsonPackageVersion>1.0.1</NewtonsoftJsonBsonPackageVersion>
|
<NewtonsoftJsonBsonPackageVersion>1.0.1</NewtonsoftJsonBsonPackageVersion>
|
||||||
<SystemComponentModelAnnotationsPackageVersion>4.5.0-preview3-26413-02</SystemComponentModelAnnotationsPackageVersion>
|
<SystemComponentModelAnnotationsPackageVersion>4.5.0-rc1-26419-03</SystemComponentModelAnnotationsPackageVersion>
|
||||||
<SystemDiagnosticsDiagnosticSourcePackageVersion>4.5.0-preview3-26413-02</SystemDiagnosticsDiagnosticSourcePackageVersion>
|
<SystemDiagnosticsDiagnosticSourcePackageVersion>4.5.0-rc1-26419-03</SystemDiagnosticsDiagnosticSourcePackageVersion>
|
||||||
<SystemThreadingTasksExtensionsPackageVersion>4.5.0-preview3-26413-02</SystemThreadingTasksExtensionsPackageVersion>
|
<SystemThreadingTasksExtensionsPackageVersion>4.5.0-rc1-26419-03</SystemThreadingTasksExtensionsPackageVersion>
|
||||||
<XunitAnalyzersPackageVersion>0.8.0</XunitAnalyzersPackageVersion>
|
<XunitAnalyzersPackageVersion>0.8.0</XunitAnalyzersPackageVersion>
|
||||||
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
||||||
<XunitRunnerVisualStudioPackageVersion>2.4.0-beta.1.build3945</XunitRunnerVisualStudioPackageVersion>
|
<XunitRunnerVisualStudioPackageVersion>2.4.0-beta.1.build3945</XunitRunnerVisualStudioPackageVersion>
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
version:2.1.0-preview3-17032
|
version:2.1.0-rc1-15774
|
||||||
commithash:d3d9c5682617da4d0a69372aae5d736ed733d156
|
commithash:ed5ca9de3c652347dbb0158a9a65eff3471d2114
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Microsoft.AspNetCore.Mvc
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An attribute that enables binding for all properties the decorated controller or Razor Page model defines.
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
|
||||||
|
public class BindPropertiesAttribute : Attribute
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// When <c>true</c>, allows properties to be bound on GET requests. When <c>false</c>, properties
|
||||||
|
/// do not get model bound or validated on GET requests.
|
||||||
|
/// <para>
|
||||||
|
/// Defaults to <c>false</c>.
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
public bool SupportsGet { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Mvc
|
namespace Microsoft.AspNetCore.Mvc
|
||||||
{
|
{
|
||||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
|
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
|
||||||
public class BindPropertyAttribute : Attribute, IModelNameProvider, IBinderTypeProviderMetadata, IRequestPredicateProvider
|
public class BindPropertyAttribute : Attribute, IModelNameProvider, IBinderTypeProviderMetadata, IRequestPredicateProvider
|
||||||
{
|
{
|
||||||
private static readonly Func<ActionContext, bool> _supportsAllRequests = (c) => true;
|
private static readonly Func<ActionContext, bool> _supportsAllRequests = (c) => true;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
{
|
{
|
||||||
private readonly MvcOptions _mvcOptions;
|
private readonly MvcOptions _mvcOptions;
|
||||||
private readonly IModelMetadataProvider _modelMetadataProvider;
|
private readonly IModelMetadataProvider _modelMetadataProvider;
|
||||||
|
private readonly Func<ActionContext, bool> _supportsAllRequests;
|
||||||
|
private readonly Func<ActionContext, bool> _supportsNonGetRequests;
|
||||||
|
|
||||||
public DefaultApplicationModelProvider(
|
public DefaultApplicationModelProvider(
|
||||||
IOptions<MvcOptions> mvcOptionsAccessor,
|
IOptions<MvcOptions> mvcOptionsAccessor,
|
||||||
|
|
@ -27,6 +29,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
{
|
{
|
||||||
_mvcOptions = mvcOptionsAccessor.Value;
|
_mvcOptions = mvcOptionsAccessor.Value;
|
||||||
_modelMetadataProvider = modelMetadataProvider;
|
_modelMetadataProvider = modelMetadataProvider;
|
||||||
|
|
||||||
|
_supportsAllRequests = _ => true;
|
||||||
|
_supportsNonGetRequests = context => !string.Equals(context.HttpContext.Request.Method, "GET", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -218,16 +223,24 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
|
|
||||||
var attributes = propertyInfo.GetCustomAttributes(inherit: true);
|
var attributes = propertyInfo.GetCustomAttributes(inherit: true);
|
||||||
|
|
||||||
|
// BindingInfo for properties can be either specified by decorating the property with binding specific attributes.
|
||||||
|
// ModelMetadata also adds information from the property's type and any configured IBindingMetadataProvider.
|
||||||
var modelMetadata = _modelMetadataProvider.GetMetadataForProperty(propertyInfo.DeclaringType, propertyInfo.Name);
|
var modelMetadata = _modelMetadataProvider.GetMetadataForProperty(propertyInfo.DeclaringType, propertyInfo.Name);
|
||||||
var bindingInfo = BindingInfo.GetBindingInfo(attributes, modelMetadata);
|
var bindingInfo = BindingInfo.GetBindingInfo(attributes, modelMetadata);
|
||||||
|
|
||||||
if (bindingInfo == null)
|
if (bindingInfo == null)
|
||||||
{
|
{
|
||||||
|
// Look for BindPropertiesAttribute on the handler type if no BindingInfo was inferred for the property.
|
||||||
|
// This allows a user to enable model binding on properties by decorating the controller type with BindPropertiesAttribute.
|
||||||
var declaringType = propertyInfo.DeclaringType;
|
var declaringType = propertyInfo.DeclaringType;
|
||||||
if (declaringType.IsDefined(typeof(BindPropertyAttribute), inherit: true))
|
var bindPropertiesAttribute = declaringType.GetCustomAttribute<BindPropertiesAttribute>(inherit: true);
|
||||||
|
if (bindPropertiesAttribute != null)
|
||||||
{
|
{
|
||||||
// Specify a BindingInfo so that the property is now considered for model binding.
|
var requestPredicate = bindPropertiesAttribute.SupportsGet ? _supportsAllRequests : _supportsNonGetRequests;
|
||||||
bindingInfo = new BindingInfo();
|
bindingInfo = new BindingInfo
|
||||||
|
{
|
||||||
|
RequestPredicate = requestPredicate,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
private readonly PageHandlerResultFilter _pageHandlerResultFilter = new PageHandlerResultFilter();
|
private readonly PageHandlerResultFilter _pageHandlerResultFilter = new PageHandlerResultFilter();
|
||||||
private readonly IModelMetadataProvider _modelMetadataProvider;
|
private readonly IModelMetadataProvider _modelMetadataProvider;
|
||||||
private readonly MvcOptions _options;
|
private readonly MvcOptions _options;
|
||||||
|
private readonly Func<ActionContext, bool> _supportsAllRequests;
|
||||||
|
private readonly Func<ActionContext, bool> _supportsNonGetRequests;
|
||||||
|
|
||||||
|
|
||||||
public DefaultPageApplicationModelProvider(
|
public DefaultPageApplicationModelProvider(
|
||||||
IModelMetadataProvider modelMetadataProvider,
|
IModelMetadataProvider modelMetadataProvider,
|
||||||
|
|
@ -27,6 +30,9 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
{
|
{
|
||||||
_modelMetadataProvider = modelMetadataProvider;
|
_modelMetadataProvider = modelMetadataProvider;
|
||||||
_options = options.Value;
|
_options = options.Value;
|
||||||
|
|
||||||
|
_supportsAllRequests = _ => true;
|
||||||
|
_supportsNonGetRequests = context => !string.Equals(context.HttpContext.Request.Method, "GET", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -262,17 +268,25 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
|
|
||||||
var propertyAttributes = property.GetCustomAttributes(inherit: true);
|
var propertyAttributes = property.GetCustomAttributes(inherit: true);
|
||||||
|
|
||||||
|
// BindingInfo for properties can be either specified by decorating the property with binding-specific attributes.
|
||||||
|
// ModelMetadata also adds information from the property's type and any configured IBindingMetadataProvider.
|
||||||
var propertyMetadata = _modelMetadataProvider.GetMetadataForProperty(property.DeclaringType, property.Name);
|
var propertyMetadata = _modelMetadataProvider.GetMetadataForProperty(property.DeclaringType, property.Name);
|
||||||
var bindingInfo = BindingInfo.GetBindingInfo(propertyAttributes, propertyMetadata);
|
var bindingInfo = BindingInfo.GetBindingInfo(propertyAttributes, propertyMetadata);
|
||||||
|
|
||||||
if (bindingInfo == null)
|
if (bindingInfo == null)
|
||||||
{
|
{
|
||||||
// Look for binding info on the handler if nothing is specified on the property.
|
// Look for BindPropertiesAttribute on the handler type if no BindingInfo was inferred for the property.
|
||||||
// This allows BindProperty attributes on handlers to apply to properties.
|
// This allows a user to enable model binding on properties by decorating the controller type with BindPropertiesAttribute.
|
||||||
var handlerType = property.DeclaringType;
|
var declaringType = property.DeclaringType;
|
||||||
var handlerAttributes = handlerType.GetCustomAttributes(inherit: true);
|
var bindPropertiesAttribute = declaringType.GetCustomAttribute<BindPropertiesAttribute>(inherit: true);
|
||||||
var handlerMetadata = _modelMetadataProvider.GetMetadataForType(property.DeclaringType);
|
if (bindPropertiesAttribute != null)
|
||||||
bindingInfo = BindingInfo.GetBindingInfo(handlerAttributes, handlerMetadata);
|
{
|
||||||
|
var requestPredicate = bindPropertiesAttribute.SupportsGet ? _supportsAllRequests : _supportsNonGetRequests;
|
||||||
|
bindingInfo = new BindingInfo
|
||||||
|
{
|
||||||
|
RequestPredicate = requestPredicate,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var model = new PagePropertyModel(property, propertyAttributes)
|
var model = new PagePropertyModel(property, propertyAttributes)
|
||||||
|
|
|
||||||
|
|
@ -1127,7 +1127,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
Assert.Equal(typeInfo, action.ActionMethod.DeclaringType.GetTypeInfo());
|
Assert.Equal(typeInfo, action.ActionMethod.DeclaringType.GetTypeInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
[BindProperty]
|
[BindProperties]
|
||||||
public class BindPropertyController
|
public class BindPropertyController
|
||||||
{
|
{
|
||||||
public string Property { get; set; }
|
public string Property { get; set; }
|
||||||
|
|
@ -1140,7 +1140,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void CreatePropertyModel_AddsBindingInfoToProperty_IfDeclaringTypeHasBindPropertyAttribute()
|
public void CreatePropertyModel_AddsBindingInfoToProperty_IfDeclaringTypeHasBindPropertiesAttribute()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var propertyInfo = typeof(BindPropertyController).GetProperty(nameof(BindPropertyController.Property));
|
var propertyInfo = typeof(BindPropertyController).GetProperty(nameof(BindPropertyController.Property));
|
||||||
|
|
@ -1155,7 +1155,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
Assert.Null(bindingInfo.BinderType);
|
Assert.Null(bindingInfo.BinderType);
|
||||||
Assert.Null(bindingInfo.BindingSource);
|
Assert.Null(bindingInfo.BindingSource);
|
||||||
Assert.Null(bindingInfo.PropertyFilterProvider);
|
Assert.Null(bindingInfo.PropertyFilterProvider);
|
||||||
Assert.Null(bindingInfo.RequestPredicate);
|
Assert.NotNull(bindingInfo.RequestPredicate);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
@ -1206,7 +1206,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
||||||
Assert.NotNull(property.BindingInfo);
|
Assert.NotNull(property.BindingInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BindProperty]
|
[BindProperties]
|
||||||
public class UserController : ControllerBase
|
public class UserController : ControllerBase
|
||||||
{
|
{
|
||||||
public string DerivedProperty { get; set; }
|
public string DerivedProperty { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -406,9 +406,9 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
public async Task RedirectToAction_WithEmptyActionName_UsesAmbientValue()
|
public async Task RedirectToAction_WithEmptyActionName_UsesAmbientValue()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var product = new List<KeyValuePair<string, string>>
|
var product = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
new KeyValuePair<string, string>("SampleInt", "20")
|
{ "SampleInt", "20" }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -522,10 +522,17 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task BindPropertyCanBeAppliedToControllers()
|
public async Task BindPropertiesAttribute_CanBeAppliedToControllers()
|
||||||
{
|
{
|
||||||
|
// Arrange
|
||||||
|
var formContent = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{ "Name", "TestName" },
|
||||||
|
{ "Id", "10" },
|
||||||
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var response = await Client.GetAsync("BindProperty/Action?Name=TestName&Id=10");
|
var response = await Client.PostAsync("BindProperties/Action", new FormUrlEncodedContent(formContent));
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
||||||
|
|
@ -537,10 +544,18 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task BindProperty_DoesNotApplyToPropertiesWithBindingInfo()
|
public async Task BindPropertiesAttribute_DoesNotApplyToPropertiesWithBindingInfo()
|
||||||
{
|
{
|
||||||
|
// Arrange
|
||||||
|
var formContent = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{ "Id", "10" },
|
||||||
|
{ "FromRoute", "12" },
|
||||||
|
{ "CustomBound", "Test" },
|
||||||
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var response = await Client.GetAsync("BindProperty/Action?Id=10&IdFromRoute=12&CustomBound=Test");
|
var response = await Client.PostAsync("BindProperties/Action", new FormUrlEncodedContent(formContent));
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
||||||
|
|
@ -552,6 +567,56 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
Assert.Equal("CustomBoundValue", data.CustomBound);
|
Assert.Equal("CustomBoundValue", data.CustomBound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task BindPropertiesAttribute_DoesNotCausePropertiesWithBindNeverAttributeToBeModelBound()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var formContent = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{ "BindNeverProperty", "Hello world" },
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var response = await Client.PostAsync("BindProperties/Action", new FormUrlEncodedContent(formContent));
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
||||||
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
var data = JsonConvert.DeserializeObject<BindPropertyControllerData>(content);
|
||||||
|
|
||||||
|
Assert.Null(data.BindNeverProperty);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task BindPropertiesAttributeWithSupportsGet_BindsOnNonGet()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var formContent = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{ "Name", "TestName" },
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var response = await Client.PostAsync("BindPropertiesSupportsGet/Action", new FormUrlEncodedContent(formContent));
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
||||||
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
Assert.Equal("TestName", content);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task BindPropertiesAttributeWithSupportsGet_BindsOnGet()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("BindPropertiesSupportsGet/Action?Name=OnGetTestName");
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
||||||
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
Assert.Equal("OnGetTestName", content);
|
||||||
|
}
|
||||||
|
|
||||||
public class BindPropertyControllerData
|
public class BindPropertyControllerData
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
@ -561,6 +626,8 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
public int? IdFromRoute { get; set; }
|
public int? IdFromRoute { get; set; }
|
||||||
|
|
||||||
public string CustomBound { get; set; }
|
public string CustomBound { get; set; }
|
||||||
|
|
||||||
|
public string BindNeverProperty { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1153,15 +1153,15 @@ Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary`1[AspNetCore.InjectedPa
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task BindPropertyAttribute_CanBeAppliedToModelType()
|
public async Task BindPropertiesAttribute_CanBeAppliedToModelType()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var expected = "Property1 = 123, Property2 = 25,";
|
var expected = "Property1 = 123, Property2 = 25,";
|
||||||
var request = new HttpRequestMessage(HttpMethod.Post, "/Pages/PropertyBinding/BindPropertyOnModel?Property1=123")
|
var request = new HttpRequestMessage(HttpMethod.Post, "/Pages/PropertyBinding/BindPropertiesOnModel?Property1=123")
|
||||||
{
|
{
|
||||||
Content = new FormUrlEncodedContent(new[]
|
Content = new FormUrlEncodedContent(new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
new KeyValuePair<string, string>("Property2", "25"),
|
{ "Property2", "25" },
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
await AddAntiforgeryHeaders(request);
|
await AddAntiforgeryHeaders(request);
|
||||||
|
|
@ -1175,12 +1175,27 @@ Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary`1[AspNetCore.InjectedPa
|
||||||
Assert.StartsWith(expected, responseContent.Trim());
|
Assert.StartsWith(expected, responseContent.Trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task BindPropertiesAttribute_CanBeAppliedToModelType_AllowsBindingOnGet()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var url = "/Pages/PropertyBinding/BindPropertiesWithSupportsGetOnModel?Property=Property-Value";
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync(url);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
await response.AssertStatusCodeAsync(HttpStatusCode.OK);
|
||||||
|
var content = await response.Content.ReadAsStringAsync();
|
||||||
|
Assert.Equal("Property-Value", content.Trim());
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task BindingInfoOnPropertiesIsPreferredToBindingInfoOnType()
|
public async Task BindingInfoOnPropertiesIsPreferredToBindingInfoOnType()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var expected = "Property1 = 123, Property2 = 25,";
|
var expected = "Property1 = 123, Property2 = 25,";
|
||||||
var request = new HttpRequestMessage(HttpMethod.Post, "/Pages/PropertyBinding/BindPropertyOnModel?Property1=123")
|
var request = new HttpRequestMessage(HttpMethod.Post, "/Pages/PropertyBinding/BindPropertiesOnModel?Property1=123")
|
||||||
{
|
{
|
||||||
Content = new FormUrlEncodedContent(new[]
|
Content = new FormUrlEncodedContent(new[]
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
public string Property1 { get; set; }
|
public string Property1 { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[BindProperty]
|
[BindProperties]
|
||||||
private class ModelLevel2 : ModelLevel1
|
private class ModelLevel2 : ModelLevel1
|
||||||
{
|
{
|
||||||
public string Property2 { get; set; }
|
public string Property2 { get; set; }
|
||||||
|
|
@ -397,7 +397,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
public override Task ExecuteAsync() => null;
|
public override Task ExecuteAsync() => null;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BindProperty]
|
[BindProperties]
|
||||||
[PageModel]
|
[PageModel]
|
||||||
private class ModelWithBindProperty
|
private class ModelWithBindProperty
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
|
|
||||||
namespace BasicWebSite
|
namespace BasicWebSite
|
||||||
{
|
{
|
||||||
[BindProperty]
|
[BindProperties]
|
||||||
public class BindPropertyController : Controller
|
public class BindPropertiesController : Controller
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
|
@ -21,7 +21,10 @@ namespace BasicWebSite
|
||||||
[ModelBinder(typeof(CustomBoundModelBinder))]
|
[ModelBinder(typeof(CustomBoundModelBinder))]
|
||||||
public string CustomBound { get; set; }
|
public string CustomBound { get; set; }
|
||||||
|
|
||||||
public object Action() => new { Name, Id, IdFromRoute, CustomBound };
|
[BindNever]
|
||||||
|
public string BindNeverProperty { get; set; }
|
||||||
|
|
||||||
|
public object Action() => new { Name, Id, IdFromRoute, CustomBound, BindNeverProperty };
|
||||||
|
|
||||||
private class CustomBoundModelBinder : IModelBinder
|
private class CustomBoundModelBinder : IModelBinder
|
||||||
{
|
{
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
|
|
||||||
|
namespace BasicWebSite
|
||||||
|
{
|
||||||
|
[BindProperties(SupportsGet = true)]
|
||||||
|
public class BindPropertiesSupportsGetController : Controller
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public IActionResult Action() => Content(Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,8 +7,8 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RazorPagesWebSite
|
namespace RazorPagesWebSite
|
||||||
{
|
{
|
||||||
[BindProperty]
|
[BindProperties]
|
||||||
public class BindPropertyOnModel : PageModel
|
public class BindPropertiesOnModel : PageModel
|
||||||
{
|
{
|
||||||
[FromQuery]
|
[FromQuery]
|
||||||
public string Property1 { get; set; }
|
public string Property1 { get; set; }
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
@page
|
@page
|
||||||
@model BindPropertyOnModel
|
@model BindPropertiesOnModel
|
||||||
|
|
||||||
Property1 = @Model.Property1, Property2 = @Model.Property2,
|
Property1 = @Model.Property1, Property2 = @Model.Property2,
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
|
namespace RazorPagesWebSite
|
||||||
|
{
|
||||||
|
[BindProperties(SupportsGet = true)]
|
||||||
|
public class BindPropertiesWithSupportsGetOnModel : PageModel
|
||||||
|
{
|
||||||
|
public string Property { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
@page
|
||||||
|
@model BindPropertiesWithSupportsGetOnModel
|
||||||
|
@Model.Property
|
||||||
Loading…
Reference in New Issue