diff --git a/NuGet.config b/NuGet.config index e2a1c6baae..2ba88b8eb4 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,12 +1,7 @@ - + - diff --git a/eng/Signing.props b/eng/Signing.props index 26491b99d1..0e8b87b4dd 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -24,6 +24,8 @@ + + - + https://github.com/aspnet/Blazor - 8df334032840bda9221fe281890e88fb1de06845 + 22f3483fdbbb4e72865574cd215af93f155cf574 - + https://github.com/aspnet/AspNetCore-Tooling - 5e7c4e5e382a7e486d9416b711fcd65bae25808b + 98b168c8947d8c7f7b3f2beb3a0561fb89cadfb5 - + https://github.com/aspnet/AspNetCore-Tooling - 5e7c4e5e382a7e486d9416b711fcd65bae25808b + 98b168c8947d8c7f7b3f2beb3a0561fb89cadfb5 - + https://github.com/aspnet/AspNetCore-Tooling - 5e7c4e5e382a7e486d9416b711fcd65bae25808b + 98b168c8947d8c7f7b3f2beb3a0561fb89cadfb5 - + https://github.com/aspnet/AspNetCore-Tooling - 5e7c4e5e382a7e486d9416b711fcd65bae25808b + 98b168c8947d8c7f7b3f2beb3a0561fb89cadfb5 - + https://github.com/aspnet/EntityFrameworkCore - 507ef211ada34b69c600d02d202761fe7af7c07f + d742250765a63eeea82f588af087205d52e6c029 - + https://github.com/aspnet/EntityFrameworkCore - 507ef211ada34b69c600d02d202761fe7af7c07f + d742250765a63eeea82f588af087205d52e6c029 - + https://github.com/aspnet/EntityFrameworkCore - 507ef211ada34b69c600d02d202761fe7af7c07f + d742250765a63eeea82f588af087205d52e6c029 - + https://github.com/aspnet/EntityFrameworkCore - 507ef211ada34b69c600d02d202761fe7af7c07f + d742250765a63eeea82f588af087205d52e6c029 - + https://github.com/aspnet/EntityFrameworkCore - 507ef211ada34b69c600d02d202761fe7af7c07f + d742250765a63eeea82f588af087205d52e6c029 - + https://github.com/aspnet/EntityFrameworkCore - 507ef211ada34b69c600d02d202761fe7af7c07f + d742250765a63eeea82f588af087205d52e6c029 - + https://github.com/aspnet/EntityFrameworkCore - 507ef211ada34b69c600d02d202761fe7af7c07f + d742250765a63eeea82f588af087205d52e6c029 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 https://github.com/dotnet/corefx a28176b5ec68b6da1472934fe9493790d1665cae - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/dotnet/core-setup - 094b6111d3d8c90d1111db4d73fd9faa755d9413 + aec4d1de74f35b86a7e78761095e9fbf4219ba37 - + https://github.com/dotnet/core-setup - 094b6111d3d8c90d1111db4d73fd9faa755d9413 + aec4d1de74f35b86a7e78761095e9fbf4219ba37 - + https://github.com/dotnet/core-setup - 094b6111d3d8c90d1111db4d73fd9faa755d9413 + aec4d1de74f35b86a7e78761095e9fbf4219ba37 - + https://github.com/dotnet/core-setup - 094b6111d3d8c90d1111db4d73fd9faa755d9413 + aec4d1de74f35b86a7e78761095e9fbf4219ba37 - + https://github.com/dotnet/corefx - 28efaabc4349d11a95f8f31eb932c84f207916ab + 468355e66daf9eaeb1978703fa6365cd1e37e644 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 https://github.com/dotnet/arcade @@ -416,9 +416,9 @@ https://github.com/dotnet/arcade 9946534da4f73e6242ca105f6798ab58119c9ab0 - + https://github.com/aspnet/Extensions - 42b3a303ba27594637de04c78aaf9f1c7af6e303 + 0e144fcac69503e15f692fd8a952d3ce2f97b183 diff --git a/eng/Versions.props b/eng/Versions.props index 407baf8c53..bfb2f61d8b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -54,110 +54,110 @@ 1.0.0-beta.19323.4 - 3.0.0-preview7-27812-08 - 3.0.0-preview7-27812-08 - 3.0.0-preview7-27812-08 - 2.1.0-preview7-27812-08 + 3.0.0-preview7-27825-05 + 3.0.0-preview7-27825-05 + 3.0.0-preview7-27825-05 + 2.1.0-preview7-27825-05 - 1.0.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 + 1.0.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 4.7.0-preview6.19264.9 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 1.7.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 - 4.6.0-preview7.19312.3 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 1.7.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 + 4.6.0-preview7.19320.1 - 3.0.0-preview7.19312.3 + 3.0.0-preview7.19320.1 - 0.10.0-preview7.19323.1 + 0.10.0-preview7.19324.2 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 - 3.0.0-preview7.19312.4 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 + 3.0.0-preview7.19325.1 - 3.0.0-preview7.19313.2 - 3.0.0-preview7.19313.2 - 3.0.0-preview7.19313.2 - 3.0.0-preview7.19313.2 - 3.0.0-preview7.19313.2 - 3.0.0-preview7.19313.2 - 3.0.0-preview7.19313.2 + 3.0.0-preview7.19325.7 + 3.0.0-preview7.19325.7 + 3.0.0-preview7.19325.7 + 3.0.0-preview7.19325.7 + 3.0.0-preview7.19325.7 + 3.0.0-preview7.19325.7 + 3.0.0-preview7.19325.7 - 3.0.0-preview7.19321.2 - 3.0.0-preview7.19321.2 - 3.0.0-preview7.19321.2 - 3.0.0-preview7.19321.2 + 3.0.0-preview7.19325.2 + 3.0.0-preview7.19325.2 + 3.0.0-preview7.19325.2 + 3.0.0-preview7.19325.2 @@ -58,4 +57,10 @@ + + + + + + diff --git a/eng/targets/ReferenceAssembly.targets b/eng/targets/ReferenceAssembly.targets index dccc945227..bb6230e633 100644 --- a/eng/targets/ReferenceAssembly.targets +++ b/eng/targets/ReferenceAssembly.targets @@ -76,10 +76,6 @@ - $(MSBuildThisFileDirectory)..\eng\ProjectReferences.props - $(TargetFrameworks) - $(TargetFramework) - diff --git a/eng/tools/RepoTasks/CreateFrameworkListFile.cs b/eng/tools/RepoTasks/CreateFrameworkListFile.cs index b0ab8c690a..19fb2bb18e 100644 --- a/eng/tools/RepoTasks/CreateFrameworkListFile.cs +++ b/eng/tools/RepoTasks/CreateFrameworkListFile.cs @@ -23,6 +23,10 @@ namespace RepoTasks [Required] public string TargetFile { get; set; } + public string ManagedRoot { get; set; } = ""; + + public string NativeRoot { get; set; } = ""; + /// /// Extra attributes to place on the root node. /// @@ -46,7 +50,6 @@ namespace RepoTasks { Item = item, Filename = Path.GetFileName(item.ItemSpec), - TargetPath = item.GetMetadata("TargetPath"), AssemblyName = FileUtilities.GetAssemblyName(item.ItemSpec), FileVersion = FileUtilities.GetFileVersion(item.ItemSpec), IsNative = item.GetMetadata("IsNativeImage") == "true", @@ -55,15 +58,14 @@ namespace RepoTasks .Where(f => !f.IsSymbolFile && (f.Filename.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || f.IsNative)) - .OrderBy(f => f.TargetPath, StringComparer.Ordinal) - .ThenBy(f => f.Filename, StringComparer.Ordinal)) + .OrderBy(f => f.Filename, StringComparer.Ordinal)) { var element = new XElement( "File", new XAttribute("Type", f.IsNative ? "Native" : "Managed"), new XAttribute( "Path", - Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/'))); + Path.Combine(f.IsNative ? NativeRoot : ManagedRoot, f.Filename).Replace('\\', '/'))); if (f.AssemblyName != null) { diff --git a/global.json b/global.json index 6828849fa2..3755502123 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "3.0.100-preview5-011568" + "version": "3.0.100-preview6-012264" }, "tools": { - "dotnet": "3.0.100-preview5-011568", + "dotnet": "3.0.100-preview6-012264", "runtimes": { "dotnet/x64": [ "$(MicrosoftNETCoreAppRuntimeVersion)" diff --git a/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs b/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs index 981de8e94c..e32fbb85ab 100644 --- a/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs +++ b/src/Antiforgery/test/DefaultAntiforgeryTokenGeneratorTest.cs @@ -284,8 +284,7 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal var ex = Assert.Throws( () => tokenProvider.TryValidateTokenSet(httpContext, null, fieldtoken, out message)); - var trimmed = ex.Message.Substring(0, ex.Message.IndexOf(Environment.NewLine)); - Assert.Equal(@"The required antiforgery cookie token must be provided.", trimmed); + Assert.StartsWith(@"The required antiforgery cookie token must be provided.", ex.Message); } [Fact] @@ -307,8 +306,7 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal var ex = Assert.Throws( () => tokenProvider.TryValidateTokenSet(httpContext, cookieToken, null, out message)); - var trimmed = ex.Message.Substring(0, ex.Message.IndexOf(Environment.NewLine)); - Assert.Equal("The required antiforgery request token must be provided.", trimmed); + Assert.StartsWith("The required antiforgery request token must be provided.", ex.Message); } [Fact] @@ -625,4 +623,4 @@ namespace Microsoft.AspNetCore.Antiforgery.Internal } } } -} \ No newline at end of file +} diff --git a/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Pages/FetchData.razor b/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Pages/FetchData.razor index 553979536a..ea1ba916c9 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Pages/FetchData.razor +++ b/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Pages/FetchData.razor @@ -40,6 +40,6 @@ else protected override async Task OnInitAsync() { - forecasts = await Http.GetJsonAsync("api/SampleData/WeatherForecasts"); + forecasts = await Http.GetJsonAsync("weatherforecast"); } } diff --git a/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Controllers/SampleDataController.cs b/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Controllers/WeatherForecastController.cs similarity index 58% rename from src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Controllers/SampleDataController.cs rename to src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Controllers/WeatherForecastController.cs index 2a7d8a515c..93cb808582 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Controllers/SampleDataController.cs +++ b/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Server/Controllers/WeatherForecastController.cs @@ -7,16 +7,24 @@ using System.Threading.Tasks; namespace BlazorHosted_CSharp.Server.Controllers { - [Route("api/[controller]")] - public class SampleDataController : Controller + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase { - private static string[] Summaries = new[] + private static readonly string[] Summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; - [HttpGet("[action]")] - public IEnumerable WeatherForecasts() + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet] + public IEnumerable Get() { var rng = new Random(); return Enumerable.Range(1, 5).Select(index => new WeatherForecast @@ -24,7 +32,8 @@ namespace BlazorHosted_CSharp.Server.Controllers Date = DateTime.Now.AddDays(index), TemperatureC = rng.Next(-20, 55), Summary = Summaries[rng.Next(Summaries.Length)] - }); + }) + .ToArray(); } } } diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs index e706648edf..8df845d88b 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs @@ -102,6 +102,21 @@ namespace Microsoft.AspNetCore.Components public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } } + + public partial class PageDisplay : Microsoft.AspNetCore.Components.IComponent + { + public PageDisplay() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.RenderFragment AuthorizingContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public Microsoft.AspNetCore.Components.RenderFragment NotAuthorizedContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Type Page { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] + public System.Collections.Generic.IDictionary PageParameters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } + public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } + } } namespace Microsoft.AspNetCore.Components.Forms @@ -231,24 +246,6 @@ namespace Microsoft.AspNetCore.Components.Forms } } -namespace Microsoft.AspNetCore.Components.Layouts -{ - public partial class PageDisplay : Microsoft.AspNetCore.Components.IComponent - { - public PageDisplay() { } - [Microsoft.AspNetCore.Components.ParameterAttribute] - public Microsoft.AspNetCore.Components.RenderFragment AuthorizingContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} - [Microsoft.AspNetCore.Components.ParameterAttribute] - public Microsoft.AspNetCore.Components.RenderFragment NotAuthorizedContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} - [Microsoft.AspNetCore.Components.ParameterAttribute] - public System.Type Page { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} - [Microsoft.AspNetCore.Components.ParameterAttribute] - public System.Collections.Generic.IDictionary PageParameters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} - public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } - public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } - } -} - namespace Microsoft.AspNetCore.Components.Routing { public partial class NavLink : Microsoft.AspNetCore.Components.IComponent, System.IDisposable @@ -270,7 +267,9 @@ namespace Microsoft.AspNetCore.Components.Routing public System.Reflection.Assembly AppAssembly { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment NotFoundContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment NotAuthorizedContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} + [Microsoft.AspNetCore.Components.ParameterAttribute] public Microsoft.AspNetCore.Components.RenderFragment AuthorizingContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } private set { throw null; }} public void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } public void Dispose() { } diff --git a/src/Components/test/testassets/BasicTestApp/DuplicateAttributesComponent.razor b/src/Components/test/testassets/BasicTestApp/DuplicateAttributesComponent.razor index 6993a5e400..80f8521de7 100644 --- a/src/Components/test/testassets/BasicTestApp/DuplicateAttributesComponent.razor +++ b/src/Components/test/testassets/BasicTestApp/DuplicateAttributesComponent.razor @@ -7,18 +7,12 @@
@functions { - void SomeMethod() - { - } - Dictionary elementValues = new Dictionary() { { "bool", true }, diff --git a/src/Components/test/testassets/BasicTestApp/DuplicateAttributesOnElementChildComponent.cs b/src/Components/test/testassets/BasicTestApp/DuplicateAttributesOnElementChildComponent.cs deleted file mode 100644 index 055ecf7149..0000000000 --- a/src/Components/test/testassets/BasicTestApp/DuplicateAttributesOnElementChildComponent.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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.Collections.Generic; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.RenderTree; - -namespace BasicTestApp -{ - // Written in C# for flexibility and because we don't currently have the ability to write this in .razor. - public class DuplicateAttributesOnElementChildComponent : ComponentBase - { - [Parameter] public string StringAttributeBefore { get; private set; } - [Parameter] public bool BoolAttributeBefore { get; private set; } - [Parameter] public string StringAttributeAfter { get; private set; } - [Parameter] public bool? BoolAttributeAfter { get; private set; } - - [Parameter(CaptureUnmatchedValues = true)] public Dictionary UnmatchedValues { get; private set; } - - protected override void BuildRenderTree(RenderTreeBuilder builder) - { - builder.OpenElement(0, "div"); - builder.AddAttribute(1, "string", StringAttributeBefore); - builder.AddAttribute(2, "bool", BoolAttributeBefore); - builder.AddMultipleAttributes(3, UnmatchedValues); - if (StringAttributeAfter != null) - { - builder.AddAttribute(4, "string", StringAttributeAfter); - } - if (BoolAttributeAfter != null) - { - builder.AddAttribute(5, "bool", BoolAttributeAfter); - } - builder.CloseElement(); - } - } -} diff --git a/src/Components/test/testassets/BasicTestApp/DuplicateAttributesOnElementChildComponent.razor b/src/Components/test/testassets/BasicTestApp/DuplicateAttributesOnElementChildComponent.razor new file mode 100644 index 0000000000..27048982f1 --- /dev/null +++ b/src/Components/test/testassets/BasicTestApp/DuplicateAttributesOnElementChildComponent.razor @@ -0,0 +1,23 @@ +@if (StringAttributeBefore != null) +{ +
+
+} +else +{ +
+
+} + +@code { + [Parameter] public string StringAttributeBefore { get; private set; } + [Parameter] public bool BoolAttributeBefore { get; private set; } + [Parameter] public string StringAttributeAfter { get; private set; } + [Parameter] public bool? BoolAttributeAfter { get; private set; } + + [Parameter(CaptureUnmatchedValues = true)] public Dictionary UnmatchedValues { get; private set; } +} diff --git a/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj index 034b037393..7bc95d9fe5 100644 --- a/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -25,6 +25,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant runtimes/$(RuntimeIdentifier)/lib/ + + $(BuildOutputTargetFolder)$(DefaultNetCoreTargetFramework) runtimes/$(RuntimeIdentifier)/native/ @@ -457,6 +459,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant diff --git a/src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs b/src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs index 8af0174431..ae1ea92816 100644 --- a/src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs +++ b/src/Hosting/Hosting/src/GenericHost/GenericWebHostBuilder.cs @@ -75,8 +75,6 @@ namespace Microsoft.AspNetCore.Hosting options.HostingStartupExceptions = _hostingStartupErrors; }); - services.AddHostedService(); - // REVIEW: This is bad since we don't own this type. Anybody could add one of these and it would mess things up // We need to flow this differently var listener = new DiagnosticListener("Microsoft.AspNetCore"); diff --git a/src/Hosting/Hosting/src/GenericHostWebHostBuilderExtensions.cs b/src/Hosting/Hosting/src/GenericHostWebHostBuilderExtensions.cs index e2610777f0..feb6da2ca4 100644 --- a/src/Hosting/Hosting/src/GenericHostWebHostBuilderExtensions.cs +++ b/src/Hosting/Hosting/src/GenericHostWebHostBuilderExtensions.cs @@ -1,5 +1,6 @@ using System; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.Extensions.Hosting { @@ -9,6 +10,7 @@ namespace Microsoft.Extensions.Hosting { var webhostBuilder = new GenericWebHostBuilder(builder); configure(webhostBuilder); + builder.ConfigureServices((context, services) => services.AddHostedService()); return builder; } } diff --git a/src/Hosting/Hosting/test/Fakes/GenericWebHostBuilderWrapper.cs b/src/Hosting/Hosting/test/Fakes/GenericWebHostBuilderWrapper.cs index 096a18cf77..876cc7199b 100644 --- a/src/Hosting/Hosting/test/Fakes/GenericWebHostBuilderWrapper.cs +++ b/src/Hosting/Hosting/test/Fakes/GenericWebHostBuilderWrapper.cs @@ -23,6 +23,7 @@ namespace Microsoft.AspNetCore.Hosting.Tests.Fakes // This is the only one that doesn't pass through public IWebHost Build() { + _hostBuilder.ConfigureServices((context, services) => services.AddHostedService()); return new GenericWebHost(_hostBuilder.Build()); } diff --git a/src/Hosting/Hosting/test/WebHostBuilderTests.cs b/src/Hosting/Hosting/test/WebHostBuilderTests.cs index ae7e111b2d..dc128dc50a 100644 --- a/src/Hosting/Hosting/test/WebHostBuilderTests.cs +++ b/src/Hosting/Hosting/test/WebHostBuilderTests.cs @@ -1271,6 +1271,80 @@ namespace Microsoft.AspNetCore.Hosting Assert.True(service.StopCalled); } + [Theory] + [MemberData(nameof(DefaultWebHostBuilders))] + public async Task HostedServicesStartedBeforeServer(IWebHostBuilder builder) + { + builder.Configure(app => { }) + .ConfigureServices(services => + { + services.AddSingleton(); + services.AddHostedService(); + services.AddSingleton(); + }); + + using var host = builder.Build(); + await host.StartAsync(); + var ordering = host.Services.GetRequiredService(); + Assert.Equal(2, ordering.Order); + await host.StopAsync(); + } + + private class StartOrder + { + public int Order { get; set; } + } + + private class MustBeStartedFirst : IHostedService + { + public MustBeStartedFirst(StartOrder ordering) + { + Ordering = ordering; + } + + public StartOrder Ordering { get; } + + public Task StartAsync(CancellationToken cancellationToken) + { + Assert.Equal(0, Ordering.Order); + Ordering.Order++; + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } + } + + private class ServerMustBeStartedSecond : IServer + { + public ServerMustBeStartedSecond(StartOrder ordering) + { + Ordering = ordering; + } + + public StartOrder Ordering { get; } + + public IFeatureCollection Features => null; + + public Task StartAsync(IHttpApplication application, CancellationToken cancellationToken) + { + Assert.Equal(1, Ordering.Order); + Ordering.Order++; + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } + + public void Dispose() + { + } + } + private static void StaticConfigureMethod(IApplicationBuilder app) { } private IWebHostBuilder CreateWebHostBuilder() diff --git a/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs b/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs index 9873a641bd..14861135a9 100644 --- a/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs +++ b/src/Http/Routing/test/UnitTests/Template/TemplateParserTests.cs @@ -509,7 +509,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse(template), "There is an incomplete parameter in the route template. Check that each '{' character has a matching " + - "'}' character." + Environment.NewLine + "Parameter name: routeTemplate"); + "'}' character. (Parameter 'routeTemplate')"); } [Theory] @@ -521,8 +521,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests // Act and Assert ExceptionAssert.Throws( () => TemplateParser.Parse(template), - "In a route parameter, '{' and '}' must be escaped with '{{' and '}}'." + Environment.NewLine + - "Parameter name: routeTemplate"); + "In a route parameter, '{' and '}' must be escaped with '{{' and '}}'. (Parameter 'routeTemplate')"); } [Theory] @@ -541,8 +540,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse(template), "An optional parameter must be at the end of the segment. In the segment '" + template + - "', optional parameter '" + parameter + "' is followed by '" + invalid + "'." - + Environment.NewLine + "Parameter name: routeTemplate"); + "', optional parameter '" + parameter + "' is followed by '" + invalid + "'. (Parameter 'routeTemplate')"); } [Theory] @@ -557,9 +555,8 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests // Act and Assert ExceptionAssert.Throws( () => TemplateParser.Parse(template), - "In the segment '"+ template +"', the optional parameter 'p2' is preceded by an invalid " + - "segment '" + parameter +"'. Only a period (.) can precede an optional parameter." + - Environment.NewLine + "Parameter name: routeTemplate"); + "In the segment '" + template + "', the optional parameter 'p2' is preceded by an invalid " + + "segment '" + parameter + "'. Only a period (.) can precede an optional parameter. (Parameter 'routeTemplate')"); } [Fact] @@ -568,8 +565,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { var ex = ExceptionAssert.Throws( () => TemplateParser.Parse("{Controller}.mvc/{id}/{controller}"), - "The route parameter name 'controller' appears more than one time in the route template." + - Environment.NewLine + "Parameter name: routeTemplate"); + "The route parameter name 'controller' appears more than one time in the route template. (Parameter 'routeTemplate')"); } [Theory] @@ -585,8 +581,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse(template), @"There is an incomplete parameter in the route template. Check that each '{' character has a " + - "matching '}' character." + Environment.NewLine + - "Parameter name: routeTemplate"); + "matching '}' character. (Parameter 'routeTemplate')"); } [Fact] @@ -596,8 +591,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse("123{a}abc{*moo}"), "A path segment that contains more than one section, such as a literal section or a parameter, " + - "cannot contain a catch-all parameter." + Environment.NewLine + - "Parameter name: routeTemplate"); + "cannot contain a catch-all parameter. (Parameter 'routeTemplate')"); } [Fact] @@ -606,9 +600,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("{*p1}/{*p2}"), - "A catch-all parameter can only appear as the last segment of the route template." + - Environment.NewLine + - "Parameter name: routeTemplate"); + "A catch-all parameter can only appear as the last segment of the route template. (Parameter 'routeTemplate')"); } [Fact] @@ -618,8 +610,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse("{*p1}abc{*p2}"), "A path segment that contains more than one section, such as a literal section or a parameter, " + - "cannot contain a catch-all parameter." + Environment.NewLine + - "Parameter name: routeTemplate"); + "cannot contain a catch-all parameter. (Parameter 'routeTemplate')"); } [Fact] @@ -631,8 +622,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests "The route parameter name '' is invalid. Route parameter names must be non-empty and cannot" + " contain these characters: '{', '}', '/'. The '?' character marks a parameter as optional," + " and can occur only at the end of the parameter. The '*' character marks a parameter as catch-all," + - " and can occur only at the start of the parameter." + Environment.NewLine + - "Parameter name: routeTemplate"); + " and can occur only at the start of the parameter. (Parameter 'routeTemplate')"); } [Theory] @@ -658,8 +648,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests // Act & Assert ExceptionAssert.Throws( - () => TemplateParser.Parse(template), expectedMessage + Environment.NewLine + - "Parameter name: routeTemplate"); + () => TemplateParser.Parse(template), expectedMessage + " (Parameter 'routeTemplate')"); } [Fact] @@ -669,8 +658,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse("foo/{{p1}"), "There is an incomplete parameter in the route template. Check that each '{' character has a " + - "matching '}' character." + Environment.NewLine + - "Parameter name: routeTemplate"); + "matching '}' character. (Parameter 'routeTemplate')"); } [Fact] @@ -680,8 +668,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse("foo/{p1}}"), "There is an incomplete parameter in the route template. Check that each '{' character has a " + - "matching '}' character." + Environment.NewLine + - "Parameter name: routeTemplate"); + "matching '}' character. (Parameter 'routeTemplate')"); } [Fact] @@ -690,9 +677,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("{aaa}/{AAA}"), - "The route parameter name 'AAA' appears more than one time in the route template." + - Environment.NewLine + - "Parameter name: routeTemplate"); + "The route parameter name 'AAA' appears more than one time in the route template. (Parameter 'routeTemplate')"); } [Fact] @@ -701,9 +686,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("{aaa}/{*AAA}"), - "The route parameter name 'AAA' appears more than one time in the route template." + - Environment.NewLine + - "Parameter name: routeTemplate"); + "The route parameter name 'AAA' appears more than one time in the route template. (Parameter 'routeTemplate')"); } [Fact] @@ -713,8 +696,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse("{a}/{aa}a}/{z}"), "There is an incomplete parameter in the route template. Check that each '{' character has a " + - "matching '}' character." + Environment.NewLine + - "Parameter name: routeTemplate"); + "matching '}' character. (Parameter 'routeTemplate')"); } [Fact] @@ -723,8 +705,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("{a}/{a{aa}/{z}"), - "In a route parameter, '{' and '}' must be escaped with '{{' and '}}'." + Environment.NewLine + - "Parameter name: routeTemplate"); + "In a route parameter, '{' and '}' must be escaped with '{{' and '}}'. (Parameter 'routeTemplate')"); } [Fact] @@ -736,8 +717,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests "The route parameter name '' is invalid. Route parameter names must be non-empty and cannot" + " contain these characters: '{', '}', '/'. The '?' character marks a parameter as optional, and" + " can occur only at the end of the parameter. The '*' character marks a parameter as catch-all," + - " and can occur only at the start of the parameter." + Environment.NewLine + - "Parameter name: routeTemplate"); + " and can occur only at the start of the parameter. (Parameter 'routeTemplate')"); } [Fact] @@ -749,8 +729,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests "The route parameter name '' is invalid. Route parameter names must be non-empty and cannot" + " contain these characters: '{', '}', '/'. The '?' character marks a parameter as optional, and" + " can occur only at the end of the parameter. The '*' character marks a parameter as catch-all," + - " and can occur only at the start of the parameter." + Environment.NewLine + - "Parameter name: routeTemplate"); + " and can occur only at the start of the parameter. (Parameter 'routeTemplate')"); } [Fact] @@ -760,8 +739,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse("{a}//{z}"), "The route template separator character '/' cannot appear consecutively. It must be separated by " + - "either a parameter or a literal value." + Environment.NewLine + - "Parameter name: routeTemplate"); + "either a parameter or a literal value. (Parameter 'routeTemplate')"); } [Fact] @@ -770,9 +748,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("foo/{p1}/{*p2}/{p3}"), - "A catch-all parameter can only appear as the last segment of the route template." + - Environment.NewLine + - "Parameter name: routeTemplate"); + "A catch-all parameter can only appear as the last segment of the route template. (Parameter 'routeTemplate')"); } [Fact] @@ -782,8 +758,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests ExceptionAssert.Throws( () => TemplateParser.Parse("foo/aa{p1}{p2}"), "A path segment cannot contain two consecutive parameters. They must be separated by a '/' or by " + - "a literal string." + Environment.NewLine + - "Parameter name: routeTemplate"); + "a literal string. (Parameter 'routeTemplate')"); } [Theory] @@ -804,8 +779,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("~foo"), - "The route template cannot start with a '~' character unless followed by a '/'." + Environment.NewLine + - "Parameter name: routeTemplate"); + "The route template cannot start with a '~' character unless followed by a '/'. (Parameter 'routeTemplate')"); } [Fact] @@ -814,9 +788,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("foor?bar"), - "The literal section 'foor?bar' is invalid. Literal sections cannot contain the '?' character." + - Environment.NewLine + - "Parameter name: routeTemplate"); + "The literal section 'foor?bar' is invalid. Literal sections cannot contain the '?' character. (Parameter 'routeTemplate')"); } [Fact] @@ -828,8 +800,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests "The route parameter name 'foor?b' is invalid. Route parameter names must be non-empty and cannot" + " contain these characters: '{', '}', '/'. The '?' character marks a parameter as optional, and" + " can occur only at the end of the parameter. The '*' character marks a parameter as catch-all," + - " and can occur only at the start of the parameter." + Environment.NewLine + - "Parameter name: routeTemplate"); + " and can occur only at the start of the parameter. (Parameter 'routeTemplate')"); } [Fact] @@ -838,8 +809,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests { ExceptionAssert.Throws( () => TemplateParser.Parse("{a}/{*b?}"), - "A catch-all parameter cannot be marked optional." + Environment.NewLine + - "Parameter name: routeTemplate"); + "A catch-all parameter cannot be marked optional. (Parameter 'routeTemplate')"); } private class TemplateEqualityComparer : IEqualityComparer diff --git a/src/Http/Routing/test/UnitTests/TemplateParserDefaultValuesTests.cs b/src/Http/Routing/test/UnitTests/TemplateParserDefaultValuesTests.cs index ac3d032491..92b2b1c120 100644 --- a/src/Http/Routing/test/UnitTests/TemplateParserDefaultValuesTests.cs +++ b/src/Http/Routing/test/UnitTests/TemplateParserDefaultValuesTests.cs @@ -95,8 +95,7 @@ namespace Microsoft.AspNetCore.Routing.Tests Assert.Equal(message, ex.Message); Assert.NotNull(ex.InnerException); - message = "An optional parameter cannot have default value." + Environment.NewLine + - "Parameter name: routeTemplate"; + message = "An optional parameter cannot have default value. (Parameter 'routeTemplate')"; Assert.Equal(message, ex.InnerException.Message); } @@ -122,8 +121,7 @@ namespace Microsoft.AspNetCore.Routing.Tests Assert.Equal(message, ex.Message); Assert.NotNull(ex.InnerException); - message = "An optional parameter cannot have default value." + Environment.NewLine + - "Parameter name: routeTemplate"; + message = "An optional parameter cannot have default value. (Parameter 'routeTemplate')"; Assert.Equal(message, ex.InnerException.Message); } diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs index e759ae515e..aee48019f4 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml.cs @@ -193,9 +193,15 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Internal result = await _userManager.AddLoginAsync(user, info); if (result.Succeeded) { - await _signInManager.SignInAsync(user, isPersistent: false); _logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider); + // If account confirmation is required, we need to show the link if we don't have a real email sender + if (_userManager.Options.SignIn.RequireConfirmedAccount) + { + return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email }); + } + + await _signInManager.SignInAsync(user, isPersistent: false); var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); var callbackUrl = Url.Page( diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs index 43ab958149..42c2d2ba53 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml.cs @@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal { @@ -192,9 +193,15 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Internal result = await _userManager.AddLoginAsync(user, info); if (result.Succeeded) { - await _signInManager.SignInAsync(user, isPersistent: false); _logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider); + // If account confirmation is required, we need to show the link if we don't have a real email sender + if (_userManager.Options.SignIn.RequireConfirmedAccount) + { + return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email }); + } + + await _signInManager.SignInAsync(user, isPersistent: false); var userId = await _userManager.GetUserIdAsync(user); var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); var callbackUrl = Url.Page( diff --git a/src/Identity/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs b/src/Identity/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs index c05bcd7f5f..dcec43485b 100644 --- a/src/Identity/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs +++ b/src/Identity/test/Identity.FunctionalTests/Pages/Account/ExternalLogin.cs @@ -1,6 +1,7 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// 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.Collections.Generic; using System.Linq; using System.Net.Http; @@ -35,11 +36,24 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests.Account { ["Input_Email"] = email }); - var goToIndex = ResponseAssert.IsRedirect(response); - var indexResponse = await Client.GetAsync(goToIndex); + var redirect = ResponseAssert.IsRedirect(response); + var indexResponse = await Client.GetAsync(redirect); var index = await ResponseAssert.IsHtmlDocumentAsync(indexResponse); - return new Index(Client, index, Context.WithAuthenticatedUser()); } + + public async Task SendEmailWithConfirmationAsync(string email, bool hasRealEmail) + { + var response = await Client.SendAsync(_emailForm, new Dictionary + { + ["Input_Email"] = email + }); + var redirect = ResponseAssert.IsRedirect(response); + Assert.True(String.Equals(RegisterConfirmation.Path + "?email=" + email, redirect.ToString(), StringComparison.OrdinalIgnoreCase)); + var registerResponse = await Client.GetAsync(redirect); + var register = await ResponseAssert.IsHtmlDocumentAsync(registerResponse); + + return new RegisterConfirmation(Client, register, hasRealEmail ? Context.WithRealEmailSender() : Context); + } } } diff --git a/src/Identity/test/Identity.FunctionalTests/RegistrationTests.cs b/src/Identity/test/Identity.FunctionalTests/RegistrationTests.cs index 905a7abc8b..760b36088f 100644 --- a/src/Identity/test/Identity.FunctionalTests/RegistrationTests.cs +++ b/src/Identity/test/Identity.FunctionalTests/RegistrationTests.cs @@ -129,6 +129,52 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests await UserStories.RegisterNewUserWithSocialLoginAsync(client, userName, email); } + [Fact] + public async Task CanRegisterWithASocialLoginProviderFromLoginWithConfirmation() + { + // Arrange + void ConfigureTestServices(IServiceCollection services) + { + services.Configure(o => o.SignIn.RequireConfirmedAccount = true) + .SetupTestThirdPartyLogin(); + } + + var client = ServerFactory + .WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)) + .CreateClient(); + + var guid = Guid.NewGuid(); + var userName = $"{guid}"; + var email = $"{guid}@example.com"; + + // Act & Assert + await UserStories.RegisterNewUserWithSocialLoginWithConfirmationAsync(client, userName, email); + } + + [Fact] + public async Task CanRegisterWithASocialLoginProviderFromLoginWithConfirmationAndRealEmailSender() + { + // Arrange + void ConfigureTestServices(IServiceCollection services) + { + services.AddSingleton(); + services + .Configure(o => o.SignIn.RequireConfirmedAccount = true) + .SetupTestThirdPartyLogin(); + } + + var client = ServerFactory + .WithWebHostBuilder(whb => whb.ConfigureServices(ConfigureTestServices)) + .CreateClient(); + + var guid = Guid.NewGuid(); + var userName = $"{guid}"; + var email = $"{guid}@example.com"; + + // Act & Assert + await UserStories.RegisterNewUserWithSocialLoginWithConfirmationAsync(client, userName, email, hasRealEmailSender: true); + } + [Fact] public async Task CanRegisterWithASocialLoginProviderFromRegister() { diff --git a/src/Identity/test/Identity.FunctionalTests/UserStories.cs b/src/Identity/test/Identity.FunctionalTests/UserStories.cs index 9944168a2b..2cc1cde822 100644 --- a/src/Identity/test/Identity.FunctionalTests/UserStories.cs +++ b/src/Identity/test/Identity.FunctionalTests/UserStories.cs @@ -80,6 +80,19 @@ namespace Microsoft.AspNetCore.Identity.FunctionalTests return await externalLogin.SendEmailAsync(email); } + internal static async Task RegisterNewUserWithSocialLoginWithConfirmationAsync(HttpClient client, string userName, string email, bool hasRealEmailSender = false) + { + var index = await Index.CreateAsync(client, new DefaultUIContext().WithSocialLoginEnabled()); + + var login = await index.ClickLoginLinkAsync(); + + var contosoLogin = await login.ClickLoginWithContosoLinkAsync(); + + var externalLogin = await contosoLogin.SendNewUserNameAsync(userName); + + return await externalLogin.SendEmailWithConfirmationAsync(email, hasRealEmailSender); + } + internal static async Task RegisterNewUserWithSocialLoginAsyncViaRegisterPage(HttpClient client, string userName, string email) { var index = await Index.CreateAsync(client, new DefaultUIContext().WithSocialLoginEnabled()); diff --git a/src/Installers/Windows/GenerateNugetPackageWithMsi.ps1 b/src/Installers/Windows/GenerateNugetPackageWithMsi.ps1 new file mode 100644 index 0000000000..fbb380eb20 --- /dev/null +++ b/src/Installers/Windows/GenerateNugetPackageWithMsi.ps1 @@ -0,0 +1,31 @@ +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. + +param( + [Parameter(Mandatory=$true)][string]$Name, + [Parameter(Mandatory=$true)][string]$MsiPath, + [Parameter(Mandatory=$false)][string]$CabPath, + [Parameter(Mandatory=$true)][string]$NuspecFile, + [Parameter(Mandatory=$true)][string]$OutputDirectory, + [Parameter(Mandatory=$true)][string]$Architecture, + [Parameter(Mandatory=$true)][string]$PackageVersion, + [Parameter(Mandatory=$true)][string]$RepoRoot, + [Parameter(Mandatory=$true)][string]$MajorVersion, + [Parameter(Mandatory=$true)][string]$MinorVersion +) + +$NuGetDir = Join-Path $RepoRoot "artifacts\Tools\nuget\$Name\$Architecture" +$NuGetExe = Join-Path $NuGetDir "nuget.exe" + +if (-not (Test-Path $NuGetDir)) { + New-Item -ItemType Directory -Force -Path $NuGetDir | Out-Null +} + +if (-not (Test-Path $NuGetExe)) { + # Using 3.5.0 to workaround https://github.com/NuGet/Home/issues/5016 + Write-Output "Downloading nuget.exe to $NuGetExe" + wget https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe -OutFile $NuGetExe +} + +& $NuGetExe pack $NuspecFile -Version $PackageVersion -OutputDirectory $OutputDirectory -NoDefaultExcludes -NoPackageAnalysis -Properties ASPNETCORE_RUNTIME_MSI=$MsiPath`;ASPNETCORE_CAB_FILE=$CabPath`;ARCH=$Architecture`;MAJOR=MajorVersion`;MINOR=MinorVersion`; +Exit $LastExitCode \ No newline at end of file diff --git a/src/Installers/Windows/SharedFramework/SharedFramework.wixproj b/src/Installers/Windows/SharedFramework/SharedFramework.wixproj index 7a8f258c7d..ed2fa9e235 100644 --- a/src/Installers/Windows/SharedFramework/SharedFramework.wixproj +++ b/src/Installers/Windows/SharedFramework/SharedFramework.wixproj @@ -21,6 +21,7 @@ $(DefineConstants);AspNetCoreSharedFrameworkSource=$(HarvestSource) $(SharedFrameworkNamespaceGuid) 2.0 + $(RepoRoot)\src\Installers\Windows\SharedFramework\SharedFrameworkPackage.nuspec @@ -79,4 +80,22 @@ Microsoft ASP.NET Core $(PackageBrandingVersion) Shared Framework ($(Platform)) $(DefineConstants);ProductName=$(ProductName) + + + + $(InstallersOutputPath)$(PackageFileName) + $(InstallersOutputPath)$(Cabinet) + + + diff --git a/src/Installers/Windows/SharedFramework/SharedFrameworkPackage.nuspec b/src/Installers/Windows/SharedFramework/SharedFrameworkPackage.nuspec new file mode 100644 index 0000000000..42367df074 --- /dev/null +++ b/src/Installers/Windows/SharedFramework/SharedFrameworkPackage.nuspec @@ -0,0 +1,19 @@ + + + + VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$ + 1.0.0 + VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$ + Microsoft + Microsoft + https://www.microsoft.com/net/dotnet_library_license.htm + https://github.com/aspnet/aspnetcore + true + $MAJOR$.$MINOR$ ASP.NET Core TargetingPack ($ARCH$) Windows Installer MSI as a .nupkg for internal Visual Studio build consumption + © Microsoft Corporation. All rights reserved. + + + + + + \ No newline at end of file diff --git a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj index ab034cb041..1780b67ecf 100644 --- a/src/Installers/Windows/TargetingPack/TargetingPack.wixproj +++ b/src/Installers/Windows/TargetingPack/TargetingPack.wixproj @@ -19,6 +19,7 @@ $(DefineConstants);AspNetCoreTargetingPackSource=$(HarvestSource) DDBB771F-963F-47D3-8510-9ABD04DBE1D1 2.0 + $(RepoRoot)\src\Installers\Windows\TargetingPack\TargetingPackPackage.nuspec @@ -75,4 +76,21 @@ + + + + $(InstallersOutputPath)$(PackageFileName) + + + diff --git a/src/Installers/Windows/TargetingPack/TargetingPackPackage.nuspec b/src/Installers/Windows/TargetingPack/TargetingPackPackage.nuspec new file mode 100644 index 0000000000..51f4a304e4 --- /dev/null +++ b/src/Installers/Windows/TargetingPack/TargetingPackPackage.nuspec @@ -0,0 +1,18 @@ + + + + VS.Redist.Common.AspNetCore.TargetingPack.$ARCH$.$MAJOR$.$MINOR$ + 1.0.0 + VS.Redist.Common.AspNetCore.TargetingPack.$ARCH$.$MAJOR$.$MINOR$ + Microsoft + Microsoft + https://www.microsoft.com/net/dotnet_library_license.htm + https://github.com/aspnet/aspnetcore + true + $MAJOR$.$MINOR$ ASP.NET Core TargetingPack ($ARCH$) Windows Installer MSI as a .nupkg for internal Visual Studio build consumption + © Microsoft Corporation. All rights reserved. + + + + + \ No newline at end of file diff --git a/src/Installers/Windows/Wix.props b/src/Installers/Windows/Wix.props index a76eaf631d..c9b7565fe8 100644 --- a/src/Installers/Windows/Wix.props +++ b/src/Installers/Windows/Wix.props @@ -25,6 +25,7 @@ $(DefineConstants);files=$(MSBuildThisFileDirectory)files $(DefineConstants);Culture=$(Cultures) + $(RepoRoot)\src\Installers\Windows\GenerateNugetPackageWithMsi.ps1 diff --git a/src/Middleware/CORS/src/Internal/CORSLoggerExtensions.cs b/src/Middleware/CORS/src/CORSLoggerExtensions.cs similarity index 99% rename from src/Middleware/CORS/src/Internal/CORSLoggerExtensions.cs rename to src/Middleware/CORS/src/CORSLoggerExtensions.cs index 58886c37c9..4a4313e92d 100644 --- a/src/Middleware/CORS/src/Internal/CORSLoggerExtensions.cs +++ b/src/Middleware/CORS/src/CORSLoggerExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Cors.Internal +namespace Microsoft.AspNetCore.Cors { internal static class CORSLoggerExtensions { diff --git a/src/Middleware/CORS/src/Infrastructure/CorsMiddleware.cs b/src/Middleware/CORS/src/Infrastructure/CorsMiddleware.cs index d376370cc6..ed3f743dfc 100644 --- a/src/Middleware/CORS/src/Infrastructure/CorsMiddleware.cs +++ b/src/Middleware/CORS/src/Infrastructure/CorsMiddleware.cs @@ -3,7 +3,6 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Cors.Internal; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; diff --git a/src/Middleware/CORS/src/Infrastructure/CorsService.cs b/src/Middleware/CORS/src/Infrastructure/CorsService.cs index 26c3bb042b..7552d81574 100644 --- a/src/Middleware/CORS/src/Infrastructure/CorsService.cs +++ b/src/Middleware/CORS/src/Infrastructure/CorsService.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; -using Microsoft.AspNetCore.Cors.Internal; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/src/Middleware/CORS/test/UnitTests/CorsPolicyTests.cs b/src/Middleware/CORS/test/UnitTests/CorsPolicyTests.cs index f49e30fabc..e99b04096c 100644 --- a/src/Middleware/CORS/test/UnitTests/CorsPolicyTests.cs +++ b/src/Middleware/CORS/test/UnitTests/CorsPolicyTests.cs @@ -41,7 +41,7 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure // Assert Assert.Equal( - $"PreflightMaxAge must be greater than or equal to 0.{Environment.NewLine}Parameter name: value", + $"PreflightMaxAge must be greater than or equal to 0. (Parameter 'value')", exception.Message); } diff --git a/src/Middleware/CORS/test/UnitTests/CorsResultTests.cs b/src/Middleware/CORS/test/UnitTests/CorsResultTests.cs index bc6e4a2d3a..e537545674 100644 --- a/src/Middleware/CORS/test/UnitTests/CorsResultTests.cs +++ b/src/Middleware/CORS/test/UnitTests/CorsResultTests.cs @@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Cors.Infrastructure // Assert Assert.Equal( - $"PreflightMaxAge must be greater than or equal to 0.{Environment.NewLine}Parameter name: value", + $"PreflightMaxAge must be greater than or equal to 0. (Parameter 'value')", exception.Message); } diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageMiddleware.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageMiddleware.cs index 0183f402d3..26db9dcb22 100644 --- a/src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageMiddleware.cs +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageMiddleware.cs @@ -8,7 +8,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal; using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/src/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs similarity index 99% rename from src/Middleware/Diagnostics.EntityFrameworkCore/src/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs index d7696a5bab..8128ac1baf 100644 --- a/src/Middleware/Diagnostics.EntityFrameworkCore/src/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/src/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal +namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore { internal static class DiagnosticsEntityFrameworkCoreLoggerExtensions { diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointMiddleware.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointMiddleware.cs index 4562bf4218..0a37bf7f3e 100644 --- a/src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointMiddleware.cs +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointMiddleware.cs @@ -5,7 +5,6 @@ using System; using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; diff --git a/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs index 437bad32f4..c503194d6c 100644 --- a/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs +++ b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs @@ -8,7 +8,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.Internal; using Microsoft.AspNetCore.Diagnostics.RazorViews; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; diff --git a/src/Middleware/Diagnostics/src/Internal/DiagnosticsLoggerExtensions.cs b/src/Middleware/Diagnostics/src/DiagnosticsLoggerExtensions.cs similarity index 97% rename from src/Middleware/Diagnostics/src/Internal/DiagnosticsLoggerExtensions.cs rename to src/Middleware/Diagnostics/src/DiagnosticsLoggerExtensions.cs index 347cc622b1..995bbc6786 100644 --- a/src/Middleware/Diagnostics/src/Internal/DiagnosticsLoggerExtensions.cs +++ b/src/Middleware/Diagnostics/src/DiagnosticsLoggerExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Diagnostics.Internal +namespace Microsoft.AspNetCore.Diagnostics { internal static class DiagnosticsLoggerExtensions { diff --git a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs index e7c324f8bb..eece3f0135 100644 --- a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs +++ b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs @@ -6,7 +6,6 @@ using System.Diagnostics; using System.Runtime.ExceptionServices; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.Internal; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/src/Middleware/HttpsPolicy/src/internal/HstsLoggingExtensions.cs b/src/Middleware/HttpsPolicy/src/HstsLoggingExtensions.cs similarity index 96% rename from src/Middleware/HttpsPolicy/src/internal/HstsLoggingExtensions.cs rename to src/Middleware/HttpsPolicy/src/HstsLoggingExtensions.cs index b9e495db56..82bf87c173 100644 --- a/src/Middleware/HttpsPolicy/src/internal/HstsLoggingExtensions.cs +++ b/src/Middleware/HttpsPolicy/src/HstsLoggingExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.HttpsPolicy.Internal +namespace Microsoft.AspNetCore.HttpsPolicy { internal static class HstsLoggingExtensions { diff --git a/src/Middleware/HttpsPolicy/src/HstsMiddleware.cs b/src/Middleware/HttpsPolicy/src/HstsMiddleware.cs index d192785064..80f92a6443 100644 --- a/src/Middleware/HttpsPolicy/src/HstsMiddleware.cs +++ b/src/Middleware/HttpsPolicy/src/HstsMiddleware.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Globalization; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.HttpsPolicy.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; diff --git a/src/Middleware/HttpsPolicy/src/internal/HttpsLoggingExtensions.cs b/src/Middleware/HttpsPolicy/src/HttpsLoggingExtensions.cs similarity index 98% rename from src/Middleware/HttpsPolicy/src/internal/HttpsLoggingExtensions.cs rename to src/Middleware/HttpsPolicy/src/HttpsLoggingExtensions.cs index 4bbf6b1904..cc71022f68 100644 --- a/src/Middleware/HttpsPolicy/src/internal/HttpsLoggingExtensions.cs +++ b/src/Middleware/HttpsPolicy/src/HttpsLoggingExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.HttpsPolicy.Internal +namespace Microsoft.AspNetCore.HttpsPolicy { internal static class HttpsLoggingExtensions { diff --git a/src/Middleware/HttpsPolicy/src/HttpsRedirectionMiddleware.cs b/src/Middleware/HttpsPolicy/src/HttpsRedirectionMiddleware.cs index 72b63f578f..1e860a0e87 100644 --- a/src/Middleware/HttpsPolicy/src/HttpsRedirectionMiddleware.cs +++ b/src/Middleware/HttpsPolicy/src/HttpsRedirectionMiddleware.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.HttpsPolicy.Internal; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/src/Middleware/Localization/src/Internal/RequestCultureProviderLoggerExtensions.cs b/src/Middleware/Localization/src/RequestCultureProviderLoggerExtensions.cs similarity index 96% rename from src/Middleware/Localization/src/Internal/RequestCultureProviderLoggerExtensions.cs rename to src/Middleware/Localization/src/RequestCultureProviderLoggerExtensions.cs index c8583ce486..a35d8ede63 100644 --- a/src/Middleware/Localization/src/Internal/RequestCultureProviderLoggerExtensions.cs +++ b/src/Middleware/Localization/src/RequestCultureProviderLoggerExtensions.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Localization.Internal +namespace Microsoft.AspNetCore.Localization { internal static class RequestCultureProviderLoggerExtensions { diff --git a/src/Middleware/Localization/src/RequestLocalizationMiddleware.cs b/src/Middleware/Localization/src/RequestLocalizationMiddleware.cs index f91260f63d..c6ec3e1c06 100644 --- a/src/Middleware/Localization/src/RequestLocalizationMiddleware.cs +++ b/src/Middleware/Localization/src/RequestLocalizationMiddleware.cs @@ -8,7 +8,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Localization.Internal; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; diff --git a/src/Middleware/ResponseCaching/src/Internal/CacheEntry/CacheEntryHelpers.cs b/src/Middleware/ResponseCaching/src/CacheEntry/CacheEntryHelpers.cs similarity index 97% rename from src/Middleware/ResponseCaching/src/Internal/CacheEntry/CacheEntryHelpers.cs rename to src/Middleware/ResponseCaching/src/CacheEntry/CacheEntryHelpers.cs index 842e56cbf3..de97be1f0f 100644 --- a/src/Middleware/ResponseCaching/src/Internal/CacheEntry/CacheEntryHelpers.cs +++ b/src/Middleware/ResponseCaching/src/CacheEntry/CacheEntryHelpers.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal static class CacheEntryHelpers { diff --git a/src/Middleware/ResponseCaching/src/Internal/CacheEntry/CachedResponse.cs b/src/Middleware/ResponseCaching/src/CacheEntry/CachedResponse.cs similarity index 89% rename from src/Middleware/ResponseCaching/src/Internal/CacheEntry/CachedResponse.cs rename to src/Middleware/ResponseCaching/src/CacheEntry/CachedResponse.cs index b7713843a9..e880691333 100644 --- a/src/Middleware/ResponseCaching/src/Internal/CacheEntry/CachedResponse.cs +++ b/src/Middleware/ResponseCaching/src/CacheEntry/CachedResponse.cs @@ -5,7 +5,7 @@ using System; using System.IO; using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class CachedResponse : IResponseCacheEntry { diff --git a/src/Middleware/ResponseCaching/src/Internal/CacheEntry/CachedVaryByRules.cs b/src/Middleware/ResponseCaching/src/CacheEntry/CachedVaryByRules.cs similarity index 88% rename from src/Middleware/ResponseCaching/src/Internal/CacheEntry/CachedVaryByRules.cs rename to src/Middleware/ResponseCaching/src/CacheEntry/CachedVaryByRules.cs index e9dc67024a..6b8023440e 100644 --- a/src/Middleware/ResponseCaching/src/Internal/CacheEntry/CachedVaryByRules.cs +++ b/src/Middleware/ResponseCaching/src/CacheEntry/CachedVaryByRules.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class CachedVaryByRules : IResponseCacheEntry { diff --git a/src/Middleware/ResponseCaching/src/Internal/FastGuid.cs b/src/Middleware/ResponseCaching/src/FastGuid.cs similarity index 97% rename from src/Middleware/ResponseCaching/src/Internal/FastGuid.cs rename to src/Middleware/ResponseCaching/src/FastGuid.cs index 571227516b..0570f13351 100644 --- a/src/Middleware/ResponseCaching/src/Internal/FastGuid.cs +++ b/src/Middleware/ResponseCaching/src/FastGuid.cs @@ -4,7 +4,7 @@ using System; using System.Threading; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class FastGuid { diff --git a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCache.cs b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCache.cs similarity index 97% rename from src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCache.cs rename to src/Middleware/ResponseCaching/src/Interfaces/IResponseCache.cs index f76c5d7452..4ca2c6e8d1 100644 --- a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCache.cs +++ b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCache.cs @@ -4,7 +4,7 @@ using System; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal interface IResponseCache { diff --git a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCacheEntry.cs b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCacheEntry.cs similarity index 80% rename from src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCacheEntry.cs rename to src/Middleware/ResponseCaching/src/Interfaces/IResponseCacheEntry.cs index c27570b899..62590c33d7 100644 --- a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCacheEntry.cs +++ b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCacheEntry.cs @@ -1,7 +1,7 @@ // 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. -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal interface IResponseCacheEntry { diff --git a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCachingKeyProvider.cs b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCachingKeyProvider.cs similarity index 95% rename from src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCachingKeyProvider.cs rename to src/Middleware/ResponseCaching/src/Interfaces/IResponseCachingKeyProvider.cs index 22da5aec00..b3ce9fc4a7 100644 --- a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCachingKeyProvider.cs +++ b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCachingKeyProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal interface IResponseCachingKeyProvider { diff --git a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCachingPolicyProvider.cs b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCachingPolicyProvider.cs similarity index 97% rename from src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCachingPolicyProvider.cs rename to src/Middleware/ResponseCaching/src/Interfaces/IResponseCachingPolicyProvider.cs index 8862b74f4c..3717971e9a 100644 --- a/src/Middleware/ResponseCaching/src/Internal/Interfaces/IResponseCachingPolicyProvider.cs +++ b/src/Middleware/ResponseCaching/src/Interfaces/IResponseCachingPolicyProvider.cs @@ -1,7 +1,7 @@ // 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. -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal interface IResponseCachingPolicyProvider { diff --git a/src/Middleware/ResponseCaching/src/Internal/Interfaces/ISystemClock.cs b/src/Middleware/ResponseCaching/src/Interfaces/ISystemClock.cs similarity index 89% rename from src/Middleware/ResponseCaching/src/Internal/Interfaces/ISystemClock.cs rename to src/Middleware/ResponseCaching/src/Interfaces/ISystemClock.cs index 4b560e3dad..c68f982927 100644 --- a/src/Middleware/ResponseCaching/src/Internal/Interfaces/ISystemClock.cs +++ b/src/Middleware/ResponseCaching/src/Interfaces/ISystemClock.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { /// /// Abstracts the system clock to facilitate testing. diff --git a/src/Middleware/ResponseCaching/src/Internal/LoggerExtensions.cs b/src/Middleware/ResponseCaching/src/LoggerExtensions.cs similarity index 99% rename from src/Middleware/ResponseCaching/src/Internal/LoggerExtensions.cs rename to src/Middleware/ResponseCaching/src/LoggerExtensions.cs index c77dc3bfa3..f45bc2fb87 100644 --- a/src/Middleware/ResponseCaching/src/Internal/LoggerExtensions.cs +++ b/src/Middleware/ResponseCaching/src/LoggerExtensions.cs @@ -5,7 +5,7 @@ using System; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { /// /// Defines *all* the logger messages produced by response caching diff --git a/src/Middleware/ResponseCaching/src/Internal/MemoryCachedResponse.cs b/src/Middleware/ResponseCaching/src/MemoryCachedResponse.cs similarity index 91% rename from src/Middleware/ResponseCaching/src/Internal/MemoryCachedResponse.cs rename to src/Middleware/ResponseCaching/src/MemoryCachedResponse.cs index d24e63a9ff..1a96453502 100644 --- a/src/Middleware/ResponseCaching/src/Internal/MemoryCachedResponse.cs +++ b/src/Middleware/ResponseCaching/src/MemoryCachedResponse.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class MemoryCachedResponse { diff --git a/src/Middleware/ResponseCaching/src/Internal/MemoryResponseCache.cs b/src/Middleware/ResponseCaching/src/MemoryResponseCache.cs similarity index 98% rename from src/Middleware/ResponseCaching/src/Internal/MemoryResponseCache.cs rename to src/Middleware/ResponseCaching/src/MemoryResponseCache.cs index 10eb67aaa9..554ab361d8 100644 --- a/src/Middleware/ResponseCaching/src/Internal/MemoryResponseCache.cs +++ b/src/Middleware/ResponseCaching/src/MemoryResponseCache.cs @@ -5,7 +5,7 @@ using System; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Memory; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class MemoryResponseCache : IResponseCache { diff --git a/src/Middleware/ResponseCaching/src/Internal/ResponseCachingContext.cs b/src/Middleware/ResponseCaching/src/ResponseCachingContext.cs similarity index 98% rename from src/Middleware/ResponseCaching/src/Internal/ResponseCachingContext.cs rename to src/Middleware/ResponseCaching/src/ResponseCachingContext.cs index e135583d4a..53ec2fbdb2 100644 --- a/src/Middleware/ResponseCaching/src/Internal/ResponseCachingContext.cs +++ b/src/Middleware/ResponseCaching/src/ResponseCachingContext.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class ResponseCachingContext { diff --git a/src/Middleware/ResponseCaching/src/Internal/ResponseCachingKeyProvider.cs b/src/Middleware/ResponseCaching/src/ResponseCachingKeyProvider.cs similarity index 99% rename from src/Middleware/ResponseCaching/src/Internal/ResponseCachingKeyProvider.cs rename to src/Middleware/ResponseCaching/src/ResponseCachingKeyProvider.cs index 6b9b654404..f35a28f7b6 100644 --- a/src/Middleware/ResponseCaching/src/Internal/ResponseCachingKeyProvider.cs +++ b/src/Middleware/ResponseCaching/src/ResponseCachingKeyProvider.cs @@ -9,7 +9,7 @@ using Microsoft.Extensions.ObjectPool; using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class ResponseCachingKeyProvider : IResponseCachingKeyProvider { diff --git a/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs b/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs index d936729197..b370841e8e 100644 --- a/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs +++ b/src/Middleware/ResponseCaching/src/ResponseCachingMiddleware.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Logging; using Microsoft.Extensions.ObjectPool; diff --git a/src/Middleware/ResponseCaching/src/ResponseCachingOptions.cs b/src/Middleware/ResponseCaching/src/ResponseCachingOptions.cs index 4fa75e2135..0a97efa7e3 100644 --- a/src/Middleware/ResponseCaching/src/ResponseCachingOptions.cs +++ b/src/Middleware/ResponseCaching/src/ResponseCachingOptions.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.ComponentModel; -using Microsoft.AspNetCore.ResponseCaching.Internal; namespace Microsoft.AspNetCore.ResponseCaching { diff --git a/src/Middleware/ResponseCaching/src/Internal/ResponseCachingPolicyProvider.cs b/src/Middleware/ResponseCaching/src/ResponseCachingPolicyProvider.cs similarity index 99% rename from src/Middleware/ResponseCaching/src/Internal/ResponseCachingPolicyProvider.cs rename to src/Middleware/ResponseCaching/src/ResponseCachingPolicyProvider.cs index 54a045c5af..3cb94ab005 100644 --- a/src/Middleware/ResponseCaching/src/Internal/ResponseCachingPolicyProvider.cs +++ b/src/Middleware/ResponseCaching/src/ResponseCachingPolicyProvider.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class ResponseCachingPolicyProvider : IResponseCachingPolicyProvider { diff --git a/src/Middleware/ResponseCaching/src/ResponseCachingServicesExtensions.cs b/src/Middleware/ResponseCaching/src/ResponseCachingServicesExtensions.cs index eccb641b59..bbcbc38999 100644 --- a/src/Middleware/ResponseCaching/src/ResponseCachingServicesExtensions.cs +++ b/src/Middleware/ResponseCaching/src/ResponseCachingServicesExtensions.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNetCore.ResponseCaching; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.ObjectPool; diff --git a/src/Middleware/ResponseCaching/src/Internal/SendFileFeatureWrapper.cs b/src/Middleware/ResponseCaching/src/SendFileFeatureWrapper.cs similarity index 95% rename from src/Middleware/ResponseCaching/src/Internal/SendFileFeatureWrapper.cs rename to src/Middleware/ResponseCaching/src/SendFileFeatureWrapper.cs index 65ac5850f8..edc71edd76 100644 --- a/src/Middleware/ResponseCaching/src/Internal/SendFileFeatureWrapper.cs +++ b/src/Middleware/ResponseCaching/src/SendFileFeatureWrapper.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class SendFileFeatureWrapper : IHttpSendFileFeature { diff --git a/src/Middleware/ResponseCaching/src/Streams/ResponseCachingStream.cs b/src/Middleware/ResponseCaching/src/Streams/ResponseCachingStream.cs index 6a0c162be4..a788778e94 100644 --- a/src/Middleware/ResponseCaching/src/Streams/ResponseCachingStream.cs +++ b/src/Middleware/ResponseCaching/src/Streams/ResponseCachingStream.cs @@ -6,7 +6,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class ResponseCachingStream : Stream { diff --git a/src/Middleware/ResponseCaching/src/Streams/SegmentReadStream.cs b/src/Middleware/ResponseCaching/src/Streams/SegmentReadStream.cs index 8234d135a9..35958933e0 100644 --- a/src/Middleware/ResponseCaching/src/Streams/SegmentReadStream.cs +++ b/src/Middleware/ResponseCaching/src/Streams/SegmentReadStream.cs @@ -7,7 +7,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class SegmentReadStream : Stream { diff --git a/src/Middleware/ResponseCaching/src/Streams/SegmentWriteStream.cs b/src/Middleware/ResponseCaching/src/Streams/SegmentWriteStream.cs index 81df72a9d1..9faa32ca76 100644 --- a/src/Middleware/ResponseCaching/src/Streams/SegmentWriteStream.cs +++ b/src/Middleware/ResponseCaching/src/Streams/SegmentWriteStream.cs @@ -7,7 +7,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal class SegmentWriteStream : Stream { diff --git a/src/Middleware/ResponseCaching/src/Streams/StreamUtilities.cs b/src/Middleware/ResponseCaching/src/Streams/StreamUtilities.cs index d128a9f8f2..0303e43fbf 100644 --- a/src/Middleware/ResponseCaching/src/Streams/StreamUtilities.cs +++ b/src/Middleware/ResponseCaching/src/Streams/StreamUtilities.cs @@ -5,7 +5,7 @@ using System; using System.Threading; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal static class StreamUtilities { diff --git a/src/Middleware/ResponseCaching/src/Internal/StringBuilderExtensions.cs b/src/Middleware/ResponseCaching/src/StringBuilderExtensions.cs similarity index 92% rename from src/Middleware/ResponseCaching/src/Internal/StringBuilderExtensions.cs rename to src/Middleware/ResponseCaching/src/StringBuilderExtensions.cs index 40169d66bc..f0ed673859 100644 --- a/src/Middleware/ResponseCaching/src/Internal/StringBuilderExtensions.cs +++ b/src/Middleware/ResponseCaching/src/StringBuilderExtensions.cs @@ -3,7 +3,7 @@ using System.Text; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { internal static class StringBuilderExtensions { diff --git a/src/Middleware/ResponseCaching/src/Internal/SystemClock.cs b/src/Middleware/ResponseCaching/src/SystemClock.cs similarity index 89% rename from src/Middleware/ResponseCaching/src/Internal/SystemClock.cs rename to src/Middleware/ResponseCaching/src/SystemClock.cs index e4462d803f..c08ddc4f0d 100644 --- a/src/Middleware/ResponseCaching/src/Internal/SystemClock.cs +++ b/src/Middleware/ResponseCaching/src/SystemClock.cs @@ -3,7 +3,7 @@ using System; -namespace Microsoft.AspNetCore.ResponseCaching.Internal +namespace Microsoft.AspNetCore.ResponseCaching { /// /// Provides access to the normal system clock. diff --git a/src/Middleware/ResponseCaching/test/ResponseCachingKeyProviderTests.cs b/src/Middleware/ResponseCaching/test/ResponseCachingKeyProviderTests.cs index 36bd3da0c8..b207b601ac 100644 --- a/src/Middleware/ResponseCaching/test/ResponseCachingKeyProviderTests.cs +++ b/src/Middleware/ResponseCaching/test/ResponseCachingKeyProviderTests.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Xunit; namespace Microsoft.AspNetCore.ResponseCaching.Tests diff --git a/src/Middleware/ResponseCaching/test/ResponseCachingMiddlewareTests.cs b/src/Middleware/ResponseCaching/test/ResponseCachingMiddlewareTests.cs index 2fb9849993..43970711ea 100644 --- a/src/Middleware/ResponseCaching/test/ResponseCachingMiddlewareTests.cs +++ b/src/Middleware/ResponseCaching/test/ResponseCachingMiddlewareTests.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Primitives; diff --git a/src/Middleware/ResponseCaching/test/ResponseCachingPolicyProviderTests.cs b/src/Middleware/ResponseCaching/test/ResponseCachingPolicyProviderTests.cs index 4f1307b4bc..8c3f55c367 100644 --- a/src/Middleware/ResponseCaching/test/ResponseCachingPolicyProviderTests.cs +++ b/src/Middleware/ResponseCaching/test/ResponseCachingPolicyProviderTests.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Microsoft.Extensions.Logging.Testing; using Microsoft.Net.Http.Headers; using Xunit; diff --git a/src/Middleware/ResponseCaching/test/SegmentReadStreamTests.cs b/src/Middleware/ResponseCaching/test/SegmentReadStreamTests.cs index 5247df3096..6520f785a0 100644 --- a/src/Middleware/ResponseCaching/test/SegmentReadStreamTests.cs +++ b/src/Middleware/ResponseCaching/test/SegmentReadStreamTests.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Xunit; namespace Microsoft.AspNetCore.ResponseCaching.Tests diff --git a/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs b/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs index 6043128e7b..251b7e8777 100644 --- a/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs +++ b/src/Middleware/ResponseCaching/test/SegmentWriteStreamTests.cs @@ -4,7 +4,6 @@ using System; using System.IO; using System.Linq; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Xunit; namespace Microsoft.AspNetCore.ResponseCaching.Tests diff --git a/src/Middleware/ResponseCaching/test/TestUtils.cs b/src/Middleware/ResponseCaching/test/TestUtils.cs index 319c1d590f..d98ba511bb 100644 --- a/src/Middleware/ResponseCaching/test/TestUtils.cs +++ b/src/Middleware/ResponseCaching/test/TestUtils.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.ResponseCaching.Internal; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; @@ -22,7 +21,7 @@ using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; using Xunit; -using ISystemClock = Microsoft.AspNetCore.ResponseCaching.Internal.ISystemClock; +using ISystemClock = Microsoft.AspNetCore.ResponseCaching.ISystemClock; namespace Microsoft.AspNetCore.ResponseCaching.Tests { diff --git a/src/Middleware/ResponseCompression/src/internal/ResponseCompressionLoggingExtensions.cs b/src/Middleware/ResponseCompression/src/ResponseCompressionLoggingExtensions.cs similarity index 98% rename from src/Middleware/ResponseCompression/src/internal/ResponseCompressionLoggingExtensions.cs rename to src/Middleware/ResponseCompression/src/ResponseCompressionLoggingExtensions.cs index bf16682498..114bd69fdb 100644 --- a/src/Middleware/ResponseCompression/src/internal/ResponseCompressionLoggingExtensions.cs +++ b/src/Middleware/ResponseCompression/src/ResponseCompressionLoggingExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.ResponseCompression.Internal +namespace Microsoft.AspNetCore.ResponseCompression { internal static class ResponseCompressionLoggingExtensions { diff --git a/src/Middleware/ResponseCompression/src/ResponseCompressionProvider.cs b/src/Middleware/ResponseCompression/src/ResponseCompressionProvider.cs index a0e00b077a..ad29ab7b2c 100644 --- a/src/Middleware/ResponseCompression/src/ResponseCompressionProvider.cs +++ b/src/Middleware/ResponseCompression/src/ResponseCompressionProvider.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.ResponseCompression.Internal; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/src/Middleware/Rewrite/ref/Microsoft.AspNetCore.Rewrite.netcoreapp3.0.cs b/src/Middleware/Rewrite/ref/Microsoft.AspNetCore.Rewrite.netcoreapp3.0.cs index 6dff9e0d5e..4a2f965186 100644 --- a/src/Middleware/Rewrite/ref/Microsoft.AspNetCore.Rewrite.netcoreapp3.0.cs +++ b/src/Middleware/Rewrite/ref/Microsoft.AspNetCore.Rewrite.netcoreapp3.0.cs @@ -69,642 +69,3 @@ namespace Microsoft.AspNetCore.Rewrite SkipRemainingRules = 2, } } -namespace Microsoft.AspNetCore.Rewrite.Internal -{ - public partial class BackReferenceCollection - { - public BackReferenceCollection(string reference) { } - public BackReferenceCollection(System.Text.RegularExpressions.GroupCollection references) { } - public string this[int index] { get { throw null; } } - public void Add(Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection references) { } - } - public partial class DelegateRule : Microsoft.AspNetCore.Rewrite.IRule - { - public DelegateRule(System.Action onApplyRule) { } - public void ApplyRule(Microsoft.AspNetCore.Rewrite.RewriteContext context) { } - } - public partial class MatchResults - { - public static readonly Microsoft.AspNetCore.Rewrite.Internal.MatchResults EmptyFailure; - public static readonly Microsoft.AspNetCore.Rewrite.Internal.MatchResults EmptySuccess; - public MatchResults() { } - public Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection BackReferences { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public bool Success { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - } - public partial class ParserContext - { - public readonly string Template; - public ParserContext(string condition) { } - public char Current { get { throw null; } } - public int Index { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public bool Back() { throw null; } - public string Capture() { throw null; } - public int GetIndex() { throw null; } - public bool HasNext() { throw null; } - public void Mark() { } - public bool Next() { throw null; } - } - public partial class Pattern - { - public Pattern(System.Collections.Generic.IList patternSegments) { } - public System.Collections.Generic.IList PatternSegments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public abstract partial class PatternSegment - { - protected PatternSegment() { } - public abstract string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences); - } - public partial class RedirectRule : Microsoft.AspNetCore.Rewrite.IRule - { - public RedirectRule(string regex, string replacement, int statusCode) { } - public System.Text.RegularExpressions.Regex InitialMatch { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public string Replacement { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public int StatusCode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public virtual void ApplyRule(Microsoft.AspNetCore.Rewrite.RewriteContext context) { } - } - public partial class RedirectToHttpsRule : Microsoft.AspNetCore.Rewrite.IRule - { - public RedirectToHttpsRule() { } - public int? SSLPort { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public int StatusCode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public virtual void ApplyRule(Microsoft.AspNetCore.Rewrite.RewriteContext context) { } - } - public partial class RedirectToWwwRule : Microsoft.AspNetCore.Rewrite.IRule - { - public readonly string[] _domains; - public readonly int _statusCode; - public RedirectToWwwRule(int statusCode) { } - public RedirectToWwwRule(int statusCode, params string[] domains) { } - public virtual void ApplyRule(Microsoft.AspNetCore.Rewrite.RewriteContext context) { } - } - public partial class RewriteRule : Microsoft.AspNetCore.Rewrite.IRule - { - public RewriteRule(string regex, string replacement, bool stopProcessing) { } - public System.Text.RegularExpressions.Regex InitialMatch { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public string Replacement { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public bool StopProcessing { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public virtual void ApplyRule(Microsoft.AspNetCore.Rewrite.RewriteContext context) { } - } - public abstract partial class UrlAction - { - protected UrlAction() { } - protected Microsoft.AspNetCore.Rewrite.Internal.Pattern Url { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public abstract void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences); - } - public abstract partial class UrlMatch - { - protected UrlMatch() { } - protected bool Negate { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public abstract Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string input, Microsoft.AspNetCore.Rewrite.RewriteContext context); - } -} -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite -{ - public partial class ApacheModRewriteRule : Microsoft.AspNetCore.Rewrite.IRule - { - public ApacheModRewriteRule(Microsoft.AspNetCore.Rewrite.Internal.UrlMatch initialMatch, System.Collections.Generic.IList conditions, System.Collections.Generic.IList urlActions) { } - public System.Collections.Generic.IList Actions { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public System.Collections.Generic.IList Conditions { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public Microsoft.AspNetCore.Rewrite.Internal.UrlMatch InitialMatch { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public virtual void ApplyRule(Microsoft.AspNetCore.Rewrite.RewriteContext context) { } - } - public partial class Condition - { - public Condition() { } - public Microsoft.AspNetCore.Rewrite.Internal.Pattern Input { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public Microsoft.AspNetCore.Rewrite.Internal.UrlMatch Match { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public bool OrNext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public static partial class ConditionEvaluator - { - public static Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(System.Collections.Generic.IEnumerable conditions, Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection backReferences) { throw null; } - public static Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(System.Collections.Generic.IEnumerable conditions, Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection backReferences, bool trackAllCaptures) { throw null; } - } - public partial class ConditionPatternParser - { - public ConditionPatternParser() { } - public Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.ParsedModRewriteInput ParseActionCondition(string condition) { throw null; } - } - public enum ConditionType - { - Regex = 0, - PropertyTest = 1, - StringComp = 2, - IntComp = 3, - } - public partial class CookieActionFactory - { - public CookieActionFactory() { } - public Microsoft.AspNetCore.Rewrite.Internal.UrlActions.ChangeCookieAction Create(string flagValue) { throw null; } - } - public partial class FileParser - { - public FileParser() { } - public System.Collections.Generic.IList Parse(System.IO.TextReader input) { throw null; } - } - public partial class FlagParser - { - public FlagParser() { } - public Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.Flags Parse(string flagString) { throw null; } - } - public partial class Flags - { - public Flags() { } - public Flags(System.Collections.Generic.IDictionary flags) { } - public System.Collections.Generic.IDictionary FlagDictionary { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public string this[Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.FlagType flag] { get { throw null; } set { } } - public bool GetValue(Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.FlagType flag, out string value) { throw null; } - public bool HasFlag(Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.FlagType flag) { throw null; } - public void SetFlag(Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.FlagType flag, string value) { } - } - public enum FlagType - { - EscapeBackreference = 0, - Chain = 1, - Cookie = 2, - DiscardPath = 3, - Env = 4, - End = 5, - Forbidden = 6, - Gone = 7, - Handler = 8, - Last = 9, - Next = 10, - NoCase = 11, - NoEscape = 12, - NoSubReq = 13, - NoVary = 14, - Or = 15, - Proxy = 16, - PassThrough = 17, - QSAppend = 18, - QSDiscard = 19, - QSLast = 20, - Redirect = 21, - Skip = 22, - Type = 23, - } - public enum OperationType - { - None = 0, - Equal = 1, - Greater = 2, - GreaterEqual = 3, - Less = 4, - LessEqual = 5, - NotEqual = 6, - Directory = 7, - RegularFile = 8, - ExistingFile = 9, - SymbolicLink = 10, - Size = 11, - ExistingUrl = 12, - Executable = 13, - } - public partial class ParsedModRewriteInput - { - public ParsedModRewriteInput() { } - public ParsedModRewriteInput(bool invert, Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.ConditionType conditionType, Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.OperationType operationType, string operand) { } - public Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.ConditionType ConditionType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public bool Invert { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public string Operand { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.OperationType OperationType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - } - public partial class RuleBuilder - { - public RuleBuilder() { } - public void AddAction(Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern, Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.Flags flags) { } - public void AddConditionFromParts(Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern, Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.ParsedModRewriteInput input, Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.Flags flags) { } - public void AddMatch(Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.ParsedModRewriteInput input, Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.Flags flags) { } - public void AddRule(string rule) { } - public Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.ApacheModRewriteRule Build() { throw null; } - } - public partial class RuleRegexParser - { - public RuleRegexParser() { } - public Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite.ParsedModRewriteInput ParseRuleRegex(string regex) { throw null; } - } - public enum SegmentType - { - Literal = 0, - ServerParameter = 1, - ConditionParameter = 2, - RuleParameter = 3, - } - public static partial class ServerVariables - { - public static Microsoft.AspNetCore.Rewrite.Internal.PatternSegment FindServerVariable(string serverVariable, Microsoft.AspNetCore.Rewrite.Internal.ParserContext context) { throw null; } - } - public partial class TestStringParser - { - public TestStringParser() { } - public Microsoft.AspNetCore.Rewrite.Internal.Pattern Parse(string testString) { throw null; } - } - public partial class Tokenizer - { - public Tokenizer() { } - public System.Collections.Generic.IList Tokenize(string rule) { throw null; } - } -} -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite -{ - public enum ActionType - { - None = 0, - Rewrite = 1, - Redirect = 2, - CustomResponse = 3, - AbortRequest = 4, - } - public partial class Condition - { - public Condition() { } - public Microsoft.AspNetCore.Rewrite.Internal.Pattern Input { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public Microsoft.AspNetCore.Rewrite.Internal.UrlMatch Match { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class ConditionCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public ConditionCollection() { } - public ConditionCollection(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.LogicalGrouping grouping, bool trackAllCaptures) { } - public int Count { get { throw null; } } - public Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.LogicalGrouping Grouping { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.Condition this[int index] { get { throw null; } } - public bool TrackAllCaptures { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public void Add(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.Condition condition) { } - public void AddConditions(System.Collections.Generic.IEnumerable conditions) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public static partial class ConditionEvaluator - { - public static Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.ConditionCollection conditions, Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection backReferences) { throw null; } - } - public partial class IISRewriteMap - { - public IISRewriteMap(string name) { } - public string this[string key] { get { throw null; } set { } } - public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - } - public partial class IISRewriteMapCollection : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - public IISRewriteMapCollection() { } - public int Count { get { throw null; } } - public Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.IISRewriteMap this[string key] { get { throw null; } } - public void Add(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.IISRewriteMap rewriteMap) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class IISUrlRewriteRule : Microsoft.AspNetCore.Rewrite.IRule - { - public IISUrlRewriteRule(string name, Microsoft.AspNetCore.Rewrite.Internal.UrlMatch initialMatch, Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.ConditionCollection conditions, Microsoft.AspNetCore.Rewrite.Internal.UrlAction action) { } - public IISUrlRewriteRule(string name, Microsoft.AspNetCore.Rewrite.Internal.UrlMatch initialMatch, Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.ConditionCollection conditions, Microsoft.AspNetCore.Rewrite.Internal.UrlAction action, bool global) { } - public Microsoft.AspNetCore.Rewrite.Internal.UrlAction Action { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.ConditionCollection Conditions { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public bool Global { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public Microsoft.AspNetCore.Rewrite.Internal.UrlMatch InitialMatch { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public virtual void ApplyRule(Microsoft.AspNetCore.Rewrite.RewriteContext context) { } - } - public partial class InputParser - { - public InputParser() { } - public InputParser(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.IISRewriteMapCollection rewriteMaps, bool alwaysUseManagedServerVariables) { } - public Microsoft.AspNetCore.Rewrite.Internal.Pattern ParseInputString(string testString) { throw null; } - public Microsoft.AspNetCore.Rewrite.Internal.Pattern ParseInputString(string testString, Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UriMatchPart uriMatchPart) { throw null; } - } - public partial class InvalidUrlRewriteFormatException : System.FormatException - { - public InvalidUrlRewriteFormatException(System.Xml.Linq.XElement element, string message) { } - public InvalidUrlRewriteFormatException(System.Xml.Linq.XElement element, string message, System.Exception innerException) { } - public int LineNumber { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public int LinePosition { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - } - public enum LogicalGrouping - { - MatchAll = 0, - MatchAny = 1, - } - public enum MatchType - { - Pattern = 0, - IsFile = 1, - IsDirectory = 2, - } - public enum PatternSyntax - { - ECMAScript = 0, - Wildcard = 1, - ExactMatch = 2, - } - public enum RedirectType - { - Permanent = 301, - Found = 302, - SeeOther = 303, - Temporary = 307, - } - public static partial class RewriteMapParser - { - public static Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.IISRewriteMapCollection Parse(System.Xml.Linq.XElement xmlRoot) { throw null; } - } - public static partial class RewriteTags - { - public const string Action = "action"; - public const string Add = "add"; - public const string AppendQueryString = "appendQueryString"; - public const string Conditions = "conditions"; - public const string Enabled = "enabled"; - public const string GlobalRules = "globalRules"; - public const string IgnoreCase = "ignoreCase"; - public const string Input = "input"; - public const string Key = "key"; - public const string LogicalGrouping = "logicalGrouping"; - public const string LogRewrittenUrl = "logRewrittenUrl"; - public const string Match = "match"; - public const string MatchPattern = "matchPattern"; - public const string MatchType = "matchType"; - public const string Name = "name"; - public const string Negate = "negate"; - public const string Pattern = "pattern"; - public const string PatternSyntax = "patternSyntax"; - public const string RedirectType = "redirectType"; - public const string Rewrite = "rewrite"; - public const string RewriteMap = "rewriteMap"; - public const string RewriteMaps = "rewriteMaps"; - public const string Rule = "rule"; - public const string Rules = "rules"; - public const string StatusCode = "statusCode"; - public const string StatusDescription = "statusDescription"; - public const string StatusReason = "statusReason"; - public const string StopProcessing = "stopProcessing"; - public const string SubStatusCode = "subStatusCode"; - public const string TrackAllCaptures = "trackAllCaptures"; - public const string Type = "type"; - public const string Url = "url"; - public const string Value = "value"; - } - public static partial class ServerVariables - { - public static Microsoft.AspNetCore.Rewrite.Internal.PatternSegment FindServerVariable(string serverVariable, Microsoft.AspNetCore.Rewrite.Internal.ParserContext context, Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UriMatchPart uriMatchPart, bool alwaysUseManagedServerVariables) { throw null; } - } - public partial class UriMatchCondition : Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.Condition - { - public UriMatchCondition(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.InputParser inputParser, string input, string pattern, Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UriMatchPart uriMatchPart, bool ignoreCase, bool negate) { } - } - public enum UriMatchPart - { - Full = 0, - Path = 1, - } - public partial class UrlRewriteFileParser - { - public UrlRewriteFileParser() { } - public System.Collections.Generic.IList Parse(System.IO.TextReader reader, bool alwaysUseManagedServerVariables) { throw null; } - } - public partial class UrlRewriteRuleBuilder - { - public UrlRewriteRuleBuilder() { } - public bool Enabled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public bool Global { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UriMatchPart UriMatchPart { get { throw null; } } - public void AddUrlAction(Microsoft.AspNetCore.Rewrite.Internal.UrlAction action) { } - public void AddUrlCondition(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.Condition condition) { } - public void AddUrlConditions(System.Collections.Generic.IEnumerable conditions) { } - public void AddUrlMatch(string input, bool ignoreCase = true, bool negate = false, Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.PatternSyntax patternSyntax = Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.PatternSyntax.ECMAScript) { } - public Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.IISUrlRewriteRule Build() { throw null; } - public void ConfigureConditionBehavior(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.LogicalGrouping logicalGrouping, bool trackAllCaptures) { } - } -} -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments -{ - public partial class ConditionMatchSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public ConditionMatchSegment(int index) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class DateTimeSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public DateTimeSegment(string segment) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReference) { throw null; } - } - public partial class HeaderSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public HeaderSegment(string header) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class IsHttpsModSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public IsHttpsModSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class IsHttpsUrlSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public IsHttpsUrlSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class IsIPV6Segment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public IsIPV6Segment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class LiteralSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public LiteralSegment(string literal) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class LocalAddressSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public LocalAddressSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class LocalPortSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public LocalPortSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class QueryStringSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public QueryStringSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackRefernces, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class RemoteAddressSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public RemoteAddressSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class RemotePortSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public RemotePortSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class RequestFileNameSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public RequestFileNameSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class RequestMethodSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public RequestMethodSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class RewriteMapSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public RewriteMapSegment(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.IISRewriteMap rewriteMap, Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class RuleMatchSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public RuleMatchSegment(int index) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class SchemeSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public SchemeSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class ServerProtocolSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public ServerProtocolSegment() { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class ToLowerSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public ToLowerSegment(Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class UrlEncodeSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public UrlEncodeSegment(Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } - public partial class UrlSegment : Microsoft.AspNetCore.Rewrite.Internal.PatternSegment - { - public UrlSegment() { } - public UrlSegment(Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite.UriMatchPart uriMatchPart) { } - public override string Evaluate(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { throw null; } - } -} -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions -{ - public partial class AbortAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public AbortAction() { } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } - public partial class ChangeCookieAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public ChangeCookieAction(string name) { } - public string Domain { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public bool HttpOnly { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public System.TimeSpan Lifetime { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public string Path { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public bool Secure { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public string Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } - public partial class CustomResponseAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public CustomResponseAction(int statusCode) { } - public int StatusCode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public string StatusDescription { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public string StatusReason { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } - public partial class ForbiddenAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public ForbiddenAction() { } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } - public partial class GoneAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public GoneAction() { } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } - public partial class NoneAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public NoneAction(Microsoft.AspNetCore.Rewrite.RuleResult result) { } - public Microsoft.AspNetCore.Rewrite.RuleResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } - public partial class RedirectAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public RedirectAction(int statusCode, Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern, bool queryStringAppend) { } - public RedirectAction(int statusCode, Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern, bool queryStringAppend, bool queryStringDelete, bool escapeBackReferences) { } - public bool EscapeBackReferences { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public bool QueryStringAppend { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public bool QueryStringDelete { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public int StatusCode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } - public partial class RewriteAction : Microsoft.AspNetCore.Rewrite.Internal.UrlAction - { - public RewriteAction(Microsoft.AspNetCore.Rewrite.RuleResult result, Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern, bool queryStringAppend) { } - public RewriteAction(Microsoft.AspNetCore.Rewrite.RuleResult result, Microsoft.AspNetCore.Rewrite.Internal.Pattern pattern, bool queryStringAppend, bool queryStringDelete, bool escapeBackReferences) { } - public bool EscapeBackReferences { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public bool QueryStringAppend { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public bool QueryStringDelete { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public Microsoft.AspNetCore.Rewrite.RuleResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } - public override void ApplyAction(Microsoft.AspNetCore.Rewrite.RewriteContext context, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection ruleBackReferences, Microsoft.AspNetCore.Rewrite.Internal.BackReferenceCollection conditionBackReferences) { } - } -} -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches -{ - public partial class ExactMatch : Microsoft.AspNetCore.Rewrite.Internal.UrlMatch - { - public ExactMatch(bool ignoreCase, string input, bool negate) { } - public override Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string pattern, Microsoft.AspNetCore.Rewrite.RewriteContext context) { throw null; } - } - public partial class FileSizeMatch : Microsoft.AspNetCore.Rewrite.Internal.UrlMatch - { - public FileSizeMatch(bool negate) { } - public override Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string input, Microsoft.AspNetCore.Rewrite.RewriteContext context) { throw null; } - } - public partial class IntegerMatch : Microsoft.AspNetCore.Rewrite.Internal.UrlMatch - { - public IntegerMatch(int value, Microsoft.AspNetCore.Rewrite.Internal.UrlMatches.IntegerOperationType operation) { } - public IntegerMatch(string value, Microsoft.AspNetCore.Rewrite.Internal.UrlMatches.IntegerOperationType operation) { } - public override Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string input, Microsoft.AspNetCore.Rewrite.RewriteContext context) { throw null; } - } - public enum IntegerOperationType - { - Equal = 0, - Greater = 1, - GreaterEqual = 2, - Less = 3, - LessEqual = 4, - NotEqual = 5, - } - public partial class IsDirectoryMatch : Microsoft.AspNetCore.Rewrite.Internal.UrlMatch - { - public IsDirectoryMatch(bool negate) { } - public override Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string pattern, Microsoft.AspNetCore.Rewrite.RewriteContext context) { throw null; } - } - public partial class IsFileMatch : Microsoft.AspNetCore.Rewrite.Internal.UrlMatch - { - public IsFileMatch(bool negate) { } - public override Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string pattern, Microsoft.AspNetCore.Rewrite.RewriteContext context) { throw null; } - } - public partial class RegexMatch : Microsoft.AspNetCore.Rewrite.Internal.UrlMatch - { - public RegexMatch(System.Text.RegularExpressions.Regex match, bool negate) { } - public override Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string pattern, Microsoft.AspNetCore.Rewrite.RewriteContext context) { throw null; } - } - public partial class StringMatch : Microsoft.AspNetCore.Rewrite.Internal.UrlMatch - { - public StringMatch(string value, Microsoft.AspNetCore.Rewrite.Internal.UrlMatches.StringOperationType operation, bool ignoreCase) { } - public override Microsoft.AspNetCore.Rewrite.Internal.MatchResults Evaluate(string input, Microsoft.AspNetCore.Rewrite.RewriteContext context) { throw null; } - } - public enum StringOperationType - { - Equal = 0, - Greater = 1, - GreaterEqual = 2, - Less = 3, - LessEqual = 4, - } -} diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ApacheModRewriteRule.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/ApacheModRewriteRule.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ApacheModRewriteRule.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/ApacheModRewriteRule.cs index d93875fb7f..51f5f3355e 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ApacheModRewriteRule.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/ApacheModRewriteRule.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Rewrite.Logging; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class ApacheModRewriteRule : IRule + internal class ApacheModRewriteRule : IRule { public UrlMatch InitialMatch { get; } public IList Conditions { get; } diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Condition.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/Condition.cs similarity index 87% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Condition.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/Condition.cs index 01db0eb1bd..34a5698041 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Condition.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/Condition.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class Condition + internal class Condition { public Pattern Input { get; set; } public UrlMatch Match { get; set; } diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionEvaluator.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/ConditionEvaluator.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionEvaluator.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/ConditionEvaluator.cs index 0038c5bab2..4785b1caab 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionEvaluator.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/ConditionEvaluator.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public static class ConditionEvaluator + internal static class ConditionEvaluator { public static MatchResults Evaluate(IEnumerable conditions, RewriteContext context, BackReferenceCollection backReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionPatternParser.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/ConditionPatternParser.cs similarity index 99% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionPatternParser.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/ConditionPatternParser.cs index 53d841b0c7..a5b64c227a 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionPatternParser.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/ConditionPatternParser.cs @@ -4,13 +4,13 @@ using System; using System.Globalization; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { /// /// Parses the "CondPattern" portion of the RewriteCond. /// RewriteCond TestString CondPattern /// - public class ConditionPatternParser + internal class ConditionPatternParser { private const char Not = '!'; private const char Dash = '-'; diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionType.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/ConditionType.cs similarity index 73% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionType.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/ConditionType.cs index 0624bbfede..fae17d1d8c 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ConditionType.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/ConditionType.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public enum ConditionType + internal enum ConditionType { Regex, PropertyTest, diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/CookieActionFactory.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/CookieActionFactory.cs similarity index 96% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/CookieActionFactory.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/CookieActionFactory.cs index 27cb805064..b4217f8b60 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/CookieActionFactory.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/CookieActionFactory.cs @@ -3,11 +3,11 @@ using System; using System.Globalization; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlActions; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class CookieActionFactory + internal class CookieActionFactory { /// /// Creates a for details. diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FileParser.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/FileParser.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FileParser.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/FileParser.cs index d301a401a3..8bb1fdf006 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FileParser.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/FileParser.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; using System.IO; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class FileParser + internal class FileParser { public IList Parse(TextReader input) { diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FlagParser.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/FlagParser.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FlagParser.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/FlagParser.cs index 3d736d7b56..b40d7c5322 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FlagParser.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/FlagParser.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class FlagParser + internal class FlagParser { private readonly IDictionary _ruleFlagLookup = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "b", FlagType.EscapeBackreference}, diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FlagType.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/FlagType.cs similarity index 86% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FlagType.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/FlagType.cs index 67ea9875bf..7567428d34 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/FlagType.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/FlagType.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public enum FlagType + internal enum FlagType { EscapeBackreference, Chain, diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Flags.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/Flags.cs similarity index 95% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Flags.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/Flags.cs index 0f5fac2c25..a180d65ef8 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Flags.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/Flags.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { // For more information of flags, and what flags we currently support: // https://github.com/aspnet/BasicMiddleware/issues/66 // http://httpd.apache.org/docs/current/expr.html#vars - public class Flags + internal class Flags { public IDictionary FlagDictionary { get; } diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/OperationType.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/OperationType.cs similarity index 82% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/OperationType.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/OperationType.cs index 1f22902d57..483fb0b03f 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/OperationType.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/OperationType.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public enum OperationType + internal enum OperationType { None, Equal, diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ParsedModRewriteCondition.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/ParsedModRewriteCondition.cs similarity index 87% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ParsedModRewriteCondition.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/ParsedModRewriteCondition.cs index 759ab51307..df56fadf85 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ParsedModRewriteCondition.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/ParsedModRewriteCondition.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class ParsedModRewriteInput + internal class ParsedModRewriteInput { public bool Invert { get; set; } public ConditionType ConditionType { get; set; } diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/RuleBuilder.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/RuleBuilder.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/RuleBuilder.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/RuleBuilder.cs index 2dd1c58c9e..b75db70da2 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/RuleBuilder.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/RuleBuilder.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; using System.Globalization; using System.Text.RegularExpressions; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; +using Microsoft.AspNetCore.Rewrite.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlMatches; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class RuleBuilder + internal class RuleBuilder { private IList _conditions; internal IList _actions = new List(); diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/RuleRegexParser.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/RuleRegexParser.cs similarity index 88% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/RuleRegexParser.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/RuleRegexParser.cs index e8c0eeec69..7003926773 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/RuleRegexParser.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/RuleRegexParser.cs @@ -3,9 +3,9 @@ using System; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public class RuleRegexParser + internal class RuleRegexParser { public ParsedModRewriteInput ParseRuleRegex(string regex) { diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/SegmentType.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/SegmentType.cs similarity index 75% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/SegmentType.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/SegmentType.cs index ee47c978cf..1d67818d36 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/SegmentType.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/SegmentType.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { - public enum SegmentType + internal enum SegmentType { Literal, ServerParameter, diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ServerVariables.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/ServerVariables.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ServerVariables.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/ServerVariables.cs index afb3a72053..fbebb2225c 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/ServerVariables.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/ServerVariables.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { /// /// mod_rewrite lookups for specific string constants. /// - public static class ServerVariables + internal static class ServerVariables { /// diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/TestStringParser.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/TestStringParser.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/TestStringParser.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/TestStringParser.cs index 151a9c7c10..73bda20d1d 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/TestStringParser.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/TestStringParser.cs @@ -3,14 +3,14 @@ using System; using System.Collections.Generic; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { /// /// Parses the TestString segment of the mod_rewrite condition. /// - public class TestStringParser + internal class TestStringParser { private const char Percent = '%'; private const char Dollar = '$'; diff --git a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Tokenizer.cs b/src/Middleware/Rewrite/src/ApacheModRewrite/Tokenizer.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Tokenizer.cs rename to src/Middleware/Rewrite/src/ApacheModRewrite/Tokenizer.cs index b9d19bd8c7..609e1b3e08 100644 --- a/src/Middleware/Rewrite/src/Internal/ApacheModRewrite/Tokenizer.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewrite/Tokenizer.cs @@ -5,12 +5,12 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; -namespace Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite +namespace Microsoft.AspNetCore.Rewrite.ApacheModRewrite { /// /// Tokenizes a mod_rewrite rule, delimited by spaces. /// - public class Tokenizer + internal class Tokenizer { private const char Space = ' '; private const char Escape = '\\'; diff --git a/src/Middleware/Rewrite/src/ApacheModRewriteOptionsExtensions.cs b/src/Middleware/Rewrite/src/ApacheModRewriteOptionsExtensions.cs index b4779aece7..127de6647e 100644 --- a/src/Middleware/Rewrite/src/ApacheModRewriteOptionsExtensions.cs +++ b/src/Middleware/Rewrite/src/ApacheModRewriteOptionsExtensions.cs @@ -3,7 +3,7 @@ using System; using System.IO; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.Rewrite diff --git a/src/Middleware/Rewrite/src/Internal/BackReferenceCollection.cs b/src/Middleware/Rewrite/src/BackReferenceCollection.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/BackReferenceCollection.cs rename to src/Middleware/Rewrite/src/BackReferenceCollection.cs index 32b91a19ce..439946129b 100644 --- a/src/Middleware/Rewrite/src/Internal/BackReferenceCollection.cs +++ b/src/Middleware/Rewrite/src/BackReferenceCollection.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class BackReferenceCollection + internal class BackReferenceCollection { private List _backReferences = new List(); diff --git a/src/Middleware/Rewrite/src/Internal/DelegateRule.cs b/src/Middleware/Rewrite/src/DelegateRule.cs similarity index 84% rename from src/Middleware/Rewrite/src/Internal/DelegateRule.cs rename to src/Middleware/Rewrite/src/DelegateRule.cs index ab8e75d1bf..7355ae5055 100644 --- a/src/Middleware/Rewrite/src/Internal/DelegateRule.cs +++ b/src/Middleware/Rewrite/src/DelegateRule.cs @@ -3,9 +3,9 @@ using System; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class DelegateRule : IRule + internal class DelegateRule : IRule { private readonly Action _onApplyRule; diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ActionType.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/ActionType.cs similarity index 75% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ActionType.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/ActionType.cs index 75bda6efa7..b38fd0e2a3 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ActionType.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/ActionType.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public enum ActionType + internal enum ActionType { None, Rewrite, diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/Condition.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/Condition.cs similarity index 87% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/Condition.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/Condition.cs index 18a24c1925..e453a1563a 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/Condition.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/Condition.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class Condition + internal class Condition { public Pattern Input { get; set; } public UrlMatch Match { get; set; } diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ConditionCollection.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/ConditionCollection.cs similarity index 93% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ConditionCollection.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/ConditionCollection.cs index 3aec4fe960..000eda85f6 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ConditionCollection.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/ConditionCollection.cs @@ -5,9 +5,9 @@ using System; using System.Collections; using System.Collections.Generic; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class ConditionCollection : IEnumerable + internal class ConditionCollection : IEnumerable { private readonly List _conditions = new List(); diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ConditionEvaluator.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/ConditionEvaluator.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ConditionEvaluator.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/ConditionEvaluator.cs index 2d50739e78..c3d9f5e945 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ConditionEvaluator.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/ConditionEvaluator.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public static class ConditionEvaluator + internal static class ConditionEvaluator { public static MatchResults Evaluate(ConditionCollection conditions, RewriteContext context, BackReferenceCollection backReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISRewriteMap.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/IISRewriteMap.cs similarity index 92% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISRewriteMap.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/IISRewriteMap.cs index 0cd52338b9..05b54ace4a 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISRewriteMap.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/IISRewriteMap.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class IISRewriteMap + internal class IISRewriteMap { private readonly Dictionary _map = new Dictionary(); diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISRewriteMapCollection.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/IISRewriteMapCollection.cs similarity index 89% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISRewriteMapCollection.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/IISRewriteMapCollection.cs index 4f8a900623..b473a5295c 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISRewriteMapCollection.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/IISRewriteMapCollection.cs @@ -4,9 +4,9 @@ using System.Collections; using System.Collections.Generic; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class IISRewriteMapCollection : IEnumerable + internal class IISRewriteMapCollection : IEnumerable { private readonly Dictionary _rewriteMaps = new Dictionary(); diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISUrlRewriteRule.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/IISUrlRewriteRule.cs similarity index 95% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISUrlRewriteRule.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/IISUrlRewriteRule.cs index d77f93d294..730477e06f 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/IISUrlRewriteRule.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/IISUrlRewriteRule.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite.Logging; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class IISUrlRewriteRule : IRule + internal class IISUrlRewriteRule : IRule { public string Name { get; } public UrlMatch InitialMatch { get; } diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/InputParser.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/InputParser.cs similarity index 98% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/InputParser.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/InputParser.cs index a68ef08bd5..cb7672b5de 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/InputParser.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/InputParser.cs @@ -4,11 +4,11 @@ using System; using System.Collections.Generic; using System.Globalization; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class InputParser + internal class InputParser { private const char Colon = ':'; private const char OpenBrace = '{'; diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/InvalidUrlRewriteFormatException.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/InvalidUrlRewriteFormatException.cs similarity index 89% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/InvalidUrlRewriteFormatException.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/InvalidUrlRewriteFormatException.cs index 8e2bac3937..f7c74be2ac 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/InvalidUrlRewriteFormatException.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/InvalidUrlRewriteFormatException.cs @@ -5,9 +5,9 @@ using System; using System.Xml; using System.Xml.Linq; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class InvalidUrlRewriteFormatException : FormatException + internal class InvalidUrlRewriteFormatException : FormatException { public int LineNumber { get; } public int LinePosition { get; } diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/LogicalGrouping.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/LogicalGrouping.cs similarity index 70% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/LogicalGrouping.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/LogicalGrouping.cs index 85dc616e89..49b653de19 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/LogicalGrouping.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/LogicalGrouping.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public enum LogicalGrouping + internal enum LogicalGrouping { MatchAll, MatchAny diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/MatchType.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/MatchType.cs similarity index 73% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/MatchType.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/MatchType.cs index 4f02dc48ce..fb5ae7c4ba 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/MatchType.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/MatchType.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public enum MatchType + internal enum MatchType { Pattern, IsFile, diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/PatternSyntax.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/PatternSyntax.cs similarity index 72% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/PatternSyntax.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/PatternSyntax.cs index f27d2c7256..0d19cf46cf 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/PatternSyntax.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/PatternSyntax.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public enum PatternSyntax + internal enum PatternSyntax { ECMAScript, Wildcard, diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RedirectType.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/RedirectType.cs similarity index 82% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RedirectType.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/RedirectType.cs index 012cc77ded..8a02b72bc3 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RedirectType.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/RedirectType.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public enum RedirectType + internal enum RedirectType { Permanent = StatusCodes.Status301MovedPermanently, Found = StatusCodes.Status302Found, diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RewriteMapParser.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/RewriteMapParser.cs similarity index 92% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RewriteMapParser.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/RewriteMapParser.cs index 4e9b21d800..c15105ca55 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RewriteMapParser.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/RewriteMapParser.cs @@ -5,9 +5,9 @@ using System; using System.Linq; using System.Xml.Linq; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public static class RewriteMapParser + internal static class RewriteMapParser { public static IISRewriteMapCollection Parse(XElement xmlRoot) { diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RewriteTags.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/RewriteTags.cs similarity index 95% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RewriteTags.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/RewriteTags.cs index d6d482bdd4..10d555625e 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/RewriteTags.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/RewriteTags.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public static class RewriteTags + internal static class RewriteTags { public const string Action = "action"; public const string Add = "add"; diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ServerVariables.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/ServerVariables.cs similarity index 96% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ServerVariables.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/ServerVariables.cs index cc991ca664..68185b6e68 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/ServerVariables.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/ServerVariables.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public static class ServerVariables + internal static class ServerVariables { /// /// Returns the matching for the given diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UriMatchCondition.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/UriMatchCondition.cs similarity index 84% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UriMatchCondition.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/UriMatchCondition.cs index c8378c6b77..0dd92a0b84 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UriMatchCondition.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/UriMatchCondition.cs @@ -3,11 +3,11 @@ using System; using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; +using Microsoft.AspNetCore.Rewrite.UrlMatches; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class UriMatchCondition : Condition + internal class UriMatchCondition : Condition { private TimeSpan _regexTimeout = TimeSpan.FromSeconds(1); diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UriMatchPart.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/UriMatchPart.cs similarity index 69% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UriMatchPart.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/UriMatchPart.cs index 25da940689..fe3407343d 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UriMatchPart.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/UriMatchPart.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public enum UriMatchPart + internal enum UriMatchPart { Full, Path diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UrlRewriteFileParser.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/UrlRewriteFileParser.cs similarity index 98% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UrlRewriteFileParser.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/UrlRewriteFileParser.cs index 6cb1d824fb..7597752744 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UrlRewriteFileParser.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/UrlRewriteFileParser.cs @@ -7,12 +7,12 @@ using System.Globalization; using System.IO; using System.Linq; using System.Xml.Linq; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; +using Microsoft.AspNetCore.Rewrite.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlMatches; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class UrlRewriteFileParser + internal class UrlRewriteFileParser { private InputParser _inputParser; diff --git a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UrlRewriteRuleBuilder.cs b/src/Middleware/Rewrite/src/IISUrlRewrite/UrlRewriteRuleBuilder.cs similarity index 95% rename from src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UrlRewriteRuleBuilder.cs rename to src/Middleware/Rewrite/src/IISUrlRewrite/UrlRewriteRuleBuilder.cs index 69ed962154..1e12bb0501 100644 --- a/src/Middleware/Rewrite/src/Internal/IISUrlRewrite/UrlRewriteRuleBuilder.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewrite/UrlRewriteRuleBuilder.cs @@ -4,11 +4,11 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; +using Microsoft.AspNetCore.Rewrite.UrlMatches; -namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite +namespace Microsoft.AspNetCore.Rewrite.IISUrlRewrite { - public class UrlRewriteRuleBuilder + internal class UrlRewriteRuleBuilder { private readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1); diff --git a/src/Middleware/Rewrite/src/IISUrlRewriteOptionsExtensions.cs b/src/Middleware/Rewrite/src/IISUrlRewriteOptionsExtensions.cs index 600a3c0656..50b32218ac 100644 --- a/src/Middleware/Rewrite/src/IISUrlRewriteOptionsExtensions.cs +++ b/src/Middleware/Rewrite/src/IISUrlRewriteOptionsExtensions.cs @@ -4,7 +4,7 @@ using System; using System.IO; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.Rewrite diff --git a/src/Middleware/Rewrite/src/Internal/MatchResults.cs b/src/Middleware/Rewrite/src/MatchResults.cs similarity index 87% rename from src/Middleware/Rewrite/src/Internal/MatchResults.cs rename to src/Middleware/Rewrite/src/MatchResults.cs index 13c505d8f0..9bb18cefa8 100644 --- a/src/Middleware/Rewrite/src/Internal/MatchResults.cs +++ b/src/Middleware/Rewrite/src/MatchResults.cs @@ -3,9 +3,9 @@ using System.Text.RegularExpressions; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class MatchResults + internal class MatchResults { public static readonly MatchResults EmptySuccess = new MatchResults { Success = true }; public static readonly MatchResults EmptyFailure = new MatchResults { Success = false }; diff --git a/src/Middleware/Rewrite/src/Internal/ParserContext.cs b/src/Middleware/Rewrite/src/ParserContext.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/ParserContext.cs rename to src/Middleware/Rewrite/src/ParserContext.cs index 50d0d3998a..624404ead0 100644 --- a/src/Middleware/Rewrite/src/Internal/ParserContext.cs +++ b/src/Middleware/Rewrite/src/ParserContext.cs @@ -1,12 +1,12 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { /// /// Represents a string iterator, with captures. /// - public class ParserContext + internal class ParserContext { public readonly string Template; public int Index { get; set; } diff --git a/src/Middleware/Rewrite/src/Internal/Pattern.cs b/src/Middleware/Rewrite/src/Pattern.cs similarity index 92% rename from src/Middleware/Rewrite/src/Internal/Pattern.cs rename to src/Middleware/Rewrite/src/Pattern.cs index fe33dfa628..8d5d9bd4ac 100644 --- a/src/Middleware/Rewrite/src/Internal/Pattern.cs +++ b/src/Middleware/Rewrite/src/Pattern.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class Pattern + internal class Pattern { public IList PatternSegments { get; } public Pattern(IList patternSegments) diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegment.cs b/src/Middleware/Rewrite/src/PatternSegment.cs similarity index 79% rename from src/Middleware/Rewrite/src/Internal/PatternSegment.cs rename to src/Middleware/Rewrite/src/PatternSegment.cs index ef2b342065..9a06354513 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public abstract class PatternSegment + internal abstract class PatternSegment { public abstract string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences); } diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/ConditionMatchSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/ConditionMatchSegment.cs similarity index 82% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/ConditionMatchSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/ConditionMatchSegment.cs index 6c131e2c1c..58e2c3be51 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/ConditionMatchSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/ConditionMatchSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class ConditionMatchSegment : PatternSegment + internal class ConditionMatchSegment : PatternSegment { private readonly int _index; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/DateTimeSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/DateTimeSegment.cs similarity index 96% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/DateTimeSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/DateTimeSegment.cs index 588a19de27..7205c120e1 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/DateTimeSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/DateTimeSegment.cs @@ -4,9 +4,9 @@ using System; using System.Globalization; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class DateTimeSegment : PatternSegment + internal class DateTimeSegment : PatternSegment { private readonly DateTimePortion _portion; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/HeaderSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/HeaderSegment.cs similarity index 83% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/HeaderSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/HeaderSegment.cs index 83bb5918e9..8e279e482a 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/HeaderSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/HeaderSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class HeaderSegment : PatternSegment + internal class HeaderSegment : PatternSegment { private readonly string _header; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/IISServerVariableSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/IISServerVariableSegment.cs similarity index 93% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/IISServerVariableSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/IISServerVariableSegment.cs index 8bc3f96cf8..a4ac6fee58 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/IISServerVariableSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/IISServerVariableSegment.cs @@ -4,7 +4,7 @@ using System; using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { internal class IISServerVariableSegment : PatternSegment { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/IsHttpsModSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/IsHttpsModSegment.cs similarity index 83% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/IsHttpsModSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/IsHttpsModSegment.cs index ba42a8ce03..eee896614c 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/IsHttpsModSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/IsHttpsModSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class IsHttpsModSegment : PatternSegment + internal class IsHttpsModSegment : PatternSegment { // Note: Mod rewrite pattern matches on lower case "on" and "off" // while IIS looks for capitalized "ON" and "OFF" diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/IsHttpsUrlSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/IsHttpsUrlSegment.cs similarity index 83% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/IsHttpsUrlSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/IsHttpsUrlSegment.cs index 106bc089c7..dda5f5ca26 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/IsHttpsUrlSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/IsHttpsUrlSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class IsHttpsUrlSegment : PatternSegment + internal class IsHttpsUrlSegment : PatternSegment { // Note: Mod rewrite pattern matches on lower case "on" and "off" // while IIS looks for capitalized "ON" and "OFF" diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/IsIPV6Segment.cs b/src/Middleware/Rewrite/src/PatternSegments/IsIPV6Segment.cs similarity index 85% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/IsIPV6Segment.cs rename to src/Middleware/Rewrite/src/PatternSegments/IsIPV6Segment.cs index 858dd45c85..b788e2a272 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/IsIPV6Segment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/IsIPV6Segment.cs @@ -3,10 +3,9 @@ using System.Net.Sockets; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - - public class IsIPV6Segment : PatternSegment + internal class IsIPV6Segment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/LiteralSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/LiteralSegment.cs similarity index 82% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/LiteralSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/LiteralSegment.cs index c89818c09b..b81ba13052 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/LiteralSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/LiteralSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class LiteralSegment : PatternSegment + internal class LiteralSegment : PatternSegment { private readonly string _literal; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/LocalAddressSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/LocalAddressSegment.cs similarity index 78% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/LocalAddressSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/LocalAddressSegment.cs index 5b6e0a2c66..f3242b6f67 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/LocalAddressSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/LocalAddressSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class LocalAddressSegment : PatternSegment + internal class LocalAddressSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/LocalPortSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/LocalPortSegment.cs similarity index 81% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/LocalPortSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/LocalPortSegment.cs index dc39080723..aab21a7b61 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/LocalPortSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/LocalPortSegment.cs @@ -3,9 +3,9 @@ using System.Globalization; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class LocalPortSegment : PatternSegment + internal class LocalPortSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/QueryStringSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/QueryStringSegment.cs similarity index 83% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/QueryStringSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/QueryStringSegment.cs index c2b2c56c39..2b2521ad35 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/QueryStringSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/QueryStringSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class QueryStringSegment : PatternSegment + internal class QueryStringSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackRefernces, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/RemoteAddressSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/RemoteAddressSegment.cs similarity index 78% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/RemoteAddressSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/RemoteAddressSegment.cs index acdb9f3a41..ae28e418f2 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/RemoteAddressSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/RemoteAddressSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class RemoteAddressSegment : PatternSegment + internal class RemoteAddressSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/RemotePortSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/RemotePortSegment.cs similarity index 80% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/RemotePortSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/RemotePortSegment.cs index 720e5493ca..236a402144 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/RemotePortSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/RemotePortSegment.cs @@ -3,9 +3,9 @@ using System.Globalization; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class RemotePortSegment : PatternSegment + internal class RemotePortSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/RequestFilenameSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/RequestFilenameSegment.cs similarity index 77% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/RequestFilenameSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/RequestFilenameSegment.cs index fb3615b9c0..06d2f985b8 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/RequestFilenameSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/RequestFilenameSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class RequestFileNameSegment : PatternSegment + internal class RequestFileNameSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/RequestMethodSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/RequestMethodSegment.cs similarity index 77% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/RequestMethodSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/RequestMethodSegment.cs index ffd106380c..d97ad872c1 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/RequestMethodSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/RequestMethodSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class RequestMethodSegment : PatternSegment + internal class RequestMethodSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/RewriteMapSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/RewriteMapSegment.cs similarity index 81% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/RewriteMapSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/RewriteMapSegment.cs index 3dd50c9fec..ec13b10ac3 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/RewriteMapSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/RewriteMapSegment.cs @@ -1,11 +1,11 @@ // 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.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class RewriteMapSegment : PatternSegment + internal class RewriteMapSegment : PatternSegment { private readonly IISRewriteMap _rewriteMap; private readonly Pattern _pattern; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/RuleMatchSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/RuleMatchSegment.cs similarity index 82% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/RuleMatchSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/RuleMatchSegment.cs index cdd4b38e24..1cdbdc68af 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/RuleMatchSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/RuleMatchSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class RuleMatchSegment : PatternSegment + internal class RuleMatchSegment : PatternSegment { private readonly int _index; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/SchemeSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/SchemeSegment.cs similarity index 78% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/SchemeSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/SchemeSegment.cs index bea7073308..1f215434a1 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/SchemeSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/SchemeSegment.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class SchemeSegment : PatternSegment + internal class SchemeSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/ServerProtocolSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/ServerProtocolSegment.cs similarity index 80% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/ServerProtocolSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/ServerProtocolSegment.cs index bf7f355194..38ea6c7446 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/ServerProtocolSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/ServerProtocolSegment.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Http.Features; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class ServerProtocolSegment : PatternSegment + internal class ServerProtocolSegment : PatternSegment { public override string Evaluate(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/ToLowerSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/ToLowerSegment.cs similarity index 89% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/ToLowerSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/ToLowerSegment.cs index dec2029658..b7863221cc 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/ToLowerSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/ToLowerSegment.cs @@ -3,9 +3,9 @@ using System.Text; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class ToLowerSegment : PatternSegment + internal class ToLowerSegment : PatternSegment { private readonly Pattern _pattern; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/UrlEncodeSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/UrlEncodeSegment.cs similarity index 90% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/UrlEncodeSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/UrlEncodeSegment.cs index dc99dd4d51..c3930165a0 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/UrlEncodeSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/UrlEncodeSegment.cs @@ -4,9 +4,9 @@ using System.Text; using System.Text.Encodings.Web; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class UrlEncodeSegment : PatternSegment + internal class UrlEncodeSegment : PatternSegment { private readonly Pattern _pattern; diff --git a/src/Middleware/Rewrite/src/Internal/PatternSegments/UrlSegment.cs b/src/Middleware/Rewrite/src/PatternSegments/UrlSegment.cs similarity index 82% rename from src/Middleware/Rewrite/src/Internal/PatternSegments/UrlSegment.cs rename to src/Middleware/Rewrite/src/PatternSegments/UrlSegment.cs index 431d5cd5fb..74c16b6816 100644 --- a/src/Middleware/Rewrite/src/Internal/PatternSegments/UrlSegment.cs +++ b/src/Middleware/Rewrite/src/PatternSegments/UrlSegment.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; -namespace Microsoft.AspNetCore.Rewrite.Internal.PatternSegments +namespace Microsoft.AspNetCore.Rewrite.PatternSegments { - public class UrlSegment : PatternSegment + internal class UrlSegment : PatternSegment { private readonly UriMatchPart _uriMatchPart; diff --git a/src/Middleware/Rewrite/src/Internal/RedirectRule.cs b/src/Middleware/Rewrite/src/RedirectRule.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/RedirectRule.cs rename to src/Middleware/Rewrite/src/RedirectRule.cs index cf7ae0767c..3685fedad3 100644 --- a/src/Middleware/Rewrite/src/Internal/RedirectRule.cs +++ b/src/Middleware/Rewrite/src/RedirectRule.cs @@ -7,9 +7,9 @@ using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; using Microsoft.AspNetCore.Rewrite.Logging; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class RedirectRule : IRule + internal class RedirectRule : IRule { private readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1); public Regex InitialMatch { get; } diff --git a/src/Middleware/Rewrite/src/Internal/RedirectToHttpsRule.cs b/src/Middleware/Rewrite/src/RedirectToHttpsRule.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/RedirectToHttpsRule.cs rename to src/Middleware/Rewrite/src/RedirectToHttpsRule.cs index ae481c8824..4231a5bd94 100644 --- a/src/Middleware/Rewrite/src/Internal/RedirectToHttpsRule.cs +++ b/src/Middleware/Rewrite/src/RedirectToHttpsRule.cs @@ -6,9 +6,9 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite.Logging; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class RedirectToHttpsRule : IRule + internal class RedirectToHttpsRule : IRule { public int? SSLPort { get; set; } public int StatusCode { get; set; } diff --git a/src/Middleware/Rewrite/src/Internal/RedirectToWwwRule.cs b/src/Middleware/Rewrite/src/RedirectToWwwRule.cs similarity index 96% rename from src/Middleware/Rewrite/src/Internal/RedirectToWwwRule.cs rename to src/Middleware/Rewrite/src/RedirectToWwwRule.cs index d368d61446..fcf9735aef 100644 --- a/src/Middleware/Rewrite/src/Internal/RedirectToWwwRule.cs +++ b/src/Middleware/Rewrite/src/RedirectToWwwRule.cs @@ -7,9 +7,9 @@ using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Rewrite.Logging; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class RedirectToWwwRule : IRule + internal class RedirectToWwwRule : IRule { public readonly int _statusCode; public readonly string[] _domains; diff --git a/src/Middleware/Rewrite/src/RewriteOptionsExtensions.cs b/src/Middleware/Rewrite/src/RewriteOptionsExtensions.cs index d1b69dbd34..88b6d783b4 100644 --- a/src/Middleware/Rewrite/src/RewriteOptionsExtensions.cs +++ b/src/Middleware/Rewrite/src/RewriteOptionsExtensions.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal; namespace Microsoft.AspNetCore.Rewrite { diff --git a/src/Middleware/Rewrite/src/Internal/RewriteRule.cs b/src/Middleware/Rewrite/src/RewriteRule.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/RewriteRule.cs rename to src/Middleware/Rewrite/src/RewriteRule.cs index 79416b548f..85835237eb 100644 --- a/src/Middleware/Rewrite/src/Internal/RewriteRule.cs +++ b/src/Middleware/Rewrite/src/RewriteRule.cs @@ -7,9 +7,9 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Rewrite.Logging; -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public class RewriteRule : IRule + internal class RewriteRule : IRule { private readonly TimeSpan _regexTimeout = TimeSpan.FromSeconds(1); public Regex InitialMatch { get; } diff --git a/src/Middleware/Rewrite/src/Internal/UrlAction.cs b/src/Middleware/Rewrite/src/UrlAction.cs similarity index 82% rename from src/Middleware/Rewrite/src/Internal/UrlAction.cs rename to src/Middleware/Rewrite/src/UrlAction.cs index b01e0c1bd8..67cfe24eea 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlAction.cs +++ b/src/Middleware/Rewrite/src/UrlAction.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public abstract class UrlAction + internal abstract class UrlAction { protected Pattern Url { get; set; } public abstract void ApplyAction(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences); diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/AbortAction.cs b/src/Middleware/Rewrite/src/UrlActions/AbortAction.cs similarity index 86% rename from src/Middleware/Rewrite/src/Internal/UrlActions/AbortAction.cs rename to src/Middleware/Rewrite/src/UrlActions/AbortAction.cs index d5c3182fb1..850b2fa566 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/AbortAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/AbortAction.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Rewrite.Logging; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class AbortAction : UrlAction + internal class AbortAction : UrlAction { public override void ApplyAction(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/ChangeCookieAction.cs b/src/Middleware/Rewrite/src/UrlActions/ChangeCookieAction.cs similarity index 95% rename from src/Middleware/Rewrite/src/Internal/UrlActions/ChangeCookieAction.cs rename to src/Middleware/Rewrite/src/UrlActions/ChangeCookieAction.cs index c758111ca1..b3b6452ac4 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/ChangeCookieAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/ChangeCookieAction.cs @@ -4,9 +4,9 @@ using System; using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class ChangeCookieAction : UrlAction + internal class ChangeCookieAction : UrlAction { private readonly Func _timeSource; private CookieOptions _cachedOptions; diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/CustomResponseAction.cs b/src/Middleware/Rewrite/src/UrlActions/CustomResponseAction.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/UrlActions/CustomResponseAction.cs rename to src/Middleware/Rewrite/src/UrlActions/CustomResponseAction.cs index 5fb4253b24..1b3fb4c2fb 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/CustomResponseAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/CustomResponseAction.cs @@ -6,9 +6,9 @@ using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Rewrite.Logging; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class CustomResponseAction : UrlAction + internal class CustomResponseAction : UrlAction { public int StatusCode { get; } public string StatusReason { get; set; } diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/ForbiddenAction.cs b/src/Middleware/Rewrite/src/UrlActions/ForbiddenAction.cs similarity index 83% rename from src/Middleware/Rewrite/src/Internal/UrlActions/ForbiddenAction.cs rename to src/Middleware/Rewrite/src/UrlActions/ForbiddenAction.cs index 3a1c14e75f..cfa007b3b8 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/ForbiddenAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/ForbiddenAction.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class ForbiddenAction : UrlAction + internal class ForbiddenAction : UrlAction { public override void ApplyAction(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/GoneAction.cs b/src/Middleware/Rewrite/src/UrlActions/GoneAction.cs similarity index 84% rename from src/Middleware/Rewrite/src/Internal/UrlActions/GoneAction.cs rename to src/Middleware/Rewrite/src/UrlActions/GoneAction.cs index f85cd22e3b..553d5ca923 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/GoneAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/GoneAction.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class GoneAction : UrlAction + internal class GoneAction : UrlAction { public override void ApplyAction(RewriteContext context, BackReferenceCollection ruleBackReferences, BackReferenceCollection conditionBackReferences) { diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/NoneAction.cs b/src/Middleware/Rewrite/src/UrlActions/NoneAction.cs similarity index 85% rename from src/Middleware/Rewrite/src/Internal/UrlActions/NoneAction.cs rename to src/Middleware/Rewrite/src/UrlActions/NoneAction.cs index 4ba171bb5e..691f453412 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/NoneAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/NoneAction.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class NoneAction : UrlAction + internal class NoneAction : UrlAction { public RuleResult Result { get; } diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/RedirectAction.cs b/src/Middleware/Rewrite/src/UrlActions/RedirectAction.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/UrlActions/RedirectAction.cs rename to src/Middleware/Rewrite/src/UrlActions/RedirectAction.cs index f3ac9d3196..4c271cae4a 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/RedirectAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/RedirectAction.cs @@ -5,9 +5,9 @@ using System; using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class RedirectAction : UrlAction + internal class RedirectAction : UrlAction { public int StatusCode { get; } public bool QueryStringAppend { get; } diff --git a/src/Middleware/Rewrite/src/Internal/UrlActions/RewriteAction.cs b/src/Middleware/Rewrite/src/UrlActions/RewriteAction.cs similarity index 97% rename from src/Middleware/Rewrite/src/Internal/UrlActions/RewriteAction.cs rename to src/Middleware/Rewrite/src/UrlActions/RewriteAction.cs index 8f9c5818d3..4f1e147a32 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlActions/RewriteAction.cs +++ b/src/Middleware/Rewrite/src/UrlActions/RewriteAction.cs @@ -5,9 +5,9 @@ using System; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlActions +namespace Microsoft.AspNetCore.Rewrite.UrlActions { - public class RewriteAction : UrlAction + internal class RewriteAction : UrlAction { public RuleResult Result { get; } public bool QueryStringAppend { get; } diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatch.cs b/src/Middleware/Rewrite/src/UrlMatch.cs similarity index 79% rename from src/Middleware/Rewrite/src/Internal/UrlMatch.cs rename to src/Middleware/Rewrite/src/UrlMatch.cs index 9d78d63d67..14e0b9f2f3 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatch.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal +namespace Microsoft.AspNetCore.Rewrite { - public abstract class UrlMatch + internal abstract class UrlMatch { protected bool Negate { get; set; } public abstract MatchResults Evaluate(string input, RewriteContext context); diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/ExactMatch.cs b/src/Middleware/Rewrite/src/UrlMatches/ExactMatch.cs similarity index 90% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/ExactMatch.cs rename to src/Middleware/Rewrite/src/UrlMatches/ExactMatch.cs index 23db120580..76e767a71d 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/ExactMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/ExactMatch.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public class ExactMatch : UrlMatch + internal class ExactMatch : UrlMatch { private readonly bool _ignoreCase; private readonly string _stringMatch; diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/FileSizeMatch.cs b/src/Middleware/Rewrite/src/UrlMatches/FileSizeMatch.cs similarity index 84% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/FileSizeMatch.cs rename to src/Middleware/Rewrite/src/UrlMatches/FileSizeMatch.cs index e798b0191c..8dd07f6fcd 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/FileSizeMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/FileSizeMatch.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public class FileSizeMatch : UrlMatch + internal class FileSizeMatch : UrlMatch { public FileSizeMatch(bool negate) { diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/IntegerMatch.cs b/src/Middleware/Rewrite/src/UrlMatches/IntegerMatch.cs similarity index 95% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/IntegerMatch.cs rename to src/Middleware/Rewrite/src/UrlMatches/IntegerMatch.cs index 73b814731f..e6dd7996c3 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/IntegerMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/IntegerMatch.cs @@ -5,9 +5,9 @@ using System; using System.Globalization; using Microsoft.AspNetCore.Rewrite; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public class IntegerMatch : UrlMatch + internal class IntegerMatch : UrlMatch { private readonly int _value; private readonly IntegerOperationType _operation; diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/IntegerOperation.cs b/src/Middleware/Rewrite/src/UrlMatches/IntegerOperation.cs similarity index 75% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/IntegerOperation.cs rename to src/Middleware/Rewrite/src/UrlMatches/IntegerOperation.cs index fce53e3844..64253ff7b8 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/IntegerOperation.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/IntegerOperation.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public enum IntegerOperationType + internal enum IntegerOperationType { Equal, Greater, diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/IsDirectoryMatch.cs b/src/Middleware/Rewrite/src/UrlMatches/IsDirectoryMatch.cs similarity index 83% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/IsDirectoryMatch.cs rename to src/Middleware/Rewrite/src/UrlMatches/IsDirectoryMatch.cs index b4361c5d31..f8745855b4 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/IsDirectoryMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/IsDirectoryMatch.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public class IsDirectoryMatch : UrlMatch + internal class IsDirectoryMatch : UrlMatch { public IsDirectoryMatch(bool negate) { diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/IsFileMatch.cs b/src/Middleware/Rewrite/src/UrlMatches/IsFileMatch.cs similarity index 84% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/IsFileMatch.cs rename to src/Middleware/Rewrite/src/UrlMatches/IsFileMatch.cs index e4d4816133..e951d6df4a 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/IsFileMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/IsFileMatch.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public class IsFileMatch : UrlMatch + internal class IsFileMatch : UrlMatch { public IsFileMatch(bool negate) { diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/RegexMatch.cs b/src/Middleware/Rewrite/src/UrlMatches/RegexMatch.cs similarity index 87% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/RegexMatch.cs rename to src/Middleware/Rewrite/src/UrlMatches/RegexMatch.cs index 131eea8f9d..e0d0319a52 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/RegexMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/RegexMatch.cs @@ -3,9 +3,9 @@ using System.Text.RegularExpressions; -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public class RegexMatch : UrlMatch + internal class RegexMatch : UrlMatch { private readonly Regex _match; diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/StringMatch.cs b/src/Middleware/Rewrite/src/UrlMatches/StringMatch.cs similarity index 94% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/StringMatch.cs rename to src/Middleware/Rewrite/src/UrlMatches/StringMatch.cs index e991144f2d..38e0fdccd2 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/StringMatch.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/StringMatch.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public class StringMatch : UrlMatch + internal class StringMatch : UrlMatch { private readonly string _value; private readonly StringOperationType _operation; diff --git a/src/Middleware/Rewrite/src/Internal/UrlMatches/StringOperation.cs b/src/Middleware/Rewrite/src/UrlMatches/StringOperation.cs similarity index 74% rename from src/Middleware/Rewrite/src/Internal/UrlMatches/StringOperation.cs rename to src/Middleware/Rewrite/src/UrlMatches/StringOperation.cs index 15ff45d5f0..b45a56e86e 100644 --- a/src/Middleware/Rewrite/src/Internal/UrlMatches/StringOperation.cs +++ b/src/Middleware/Rewrite/src/UrlMatches/StringOperation.cs @@ -1,9 +1,9 @@ // 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. -namespace Microsoft.AspNetCore.Rewrite.Internal.UrlMatches +namespace Microsoft.AspNetCore.Rewrite.UrlMatches { - public enum StringOperationType + internal enum StringOperationType { Equal, Greater, diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/ConditionPatternParserTest.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/ConditionPatternParserTest.cs index d9dc2a5cf8..2bd799cb57 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/ConditionPatternParserTest.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/ConditionPatternParserTest.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite @@ -10,16 +10,16 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite public class ConditionPatternParserTest { [Theory] - [InlineData(">hey", OperationType.Greater, "hey", ConditionType.StringComp)] - [InlineData("=hey", OperationType.GreaterEqual, "hey", ConditionType.StringComp)] - [InlineData("<=hey", OperationType.LessEqual, "hey", ConditionType.StringComp)] - [InlineData("=hey", OperationType.Equal, "hey", ConditionType.StringComp)] - public void ConditionPatternParser_CheckStringComp(string condition, OperationType operation, string variable, ConditionType conditionType) + [InlineData(">hey", (int)OperationType.Greater, "hey", (int)ConditionType.StringComp)] + [InlineData("=hey", (int)OperationType.GreaterEqual, "hey", (int)ConditionType.StringComp)] + [InlineData("<=hey", (int)OperationType.LessEqual, "hey", (int)ConditionType.StringComp)] + [InlineData("=hey", (int)OperationType.Equal, "hey", (int)ConditionType.StringComp)] + public void ConditionPatternParser_CheckStringComp(string condition, int operation, string variable, int conditionType) { var results = new ConditionPatternParser().ParseActionCondition(condition); - var expected = new ParsedModRewriteInput { OperationType = operation, ConditionType = conditionType, Operand = variable, Invert = false }; + var expected = new ParsedModRewriteInput { OperationType = (OperationType)operation, ConditionType = (ConditionType)conditionType, Operand = variable, Invert = false }; Assert.True(CompareConditions(expected, results)); } @@ -34,53 +34,53 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite } [Theory] - [InlineData("-d", OperationType.Directory, ConditionType.PropertyTest)] - [InlineData("-f", OperationType.RegularFile, ConditionType.PropertyTest)] - [InlineData("-F", OperationType.ExistingFile, ConditionType.PropertyTest)] - [InlineData("-h", OperationType.SymbolicLink, ConditionType.PropertyTest)] - [InlineData("-L", OperationType.SymbolicLink, ConditionType.PropertyTest)] - [InlineData("-l", OperationType.SymbolicLink, ConditionType.PropertyTest)] - [InlineData("-s", OperationType.Size, ConditionType.PropertyTest)] - [InlineData("-U", OperationType.ExistingUrl, ConditionType.PropertyTest)] - [InlineData("-x", OperationType.Executable, ConditionType.PropertyTest)] - public void ConditionPatternParser_CheckFileOperations(string condition, OperationType operation, ConditionType cond) + [InlineData("-d", (int)OperationType.Directory, (int)ConditionType.PropertyTest)] + [InlineData("-f", (int)OperationType.RegularFile, (int)ConditionType.PropertyTest)] + [InlineData("-F", (int)OperationType.ExistingFile, (int)ConditionType.PropertyTest)] + [InlineData("-h", (int)OperationType.SymbolicLink, (int)ConditionType.PropertyTest)] + [InlineData("-L", (int)OperationType.SymbolicLink, (int)ConditionType.PropertyTest)] + [InlineData("-l", (int)OperationType.SymbolicLink, (int)ConditionType.PropertyTest)] + [InlineData("-s", (int)OperationType.Size, (int)ConditionType.PropertyTest)] + [InlineData("-U", (int)OperationType.ExistingUrl, (int)ConditionType.PropertyTest)] + [InlineData("-x", (int)OperationType.Executable, (int)ConditionType.PropertyTest)] + public void ConditionPatternParser_CheckFileOperations(string condition, int operation, int cond) { var results = new ConditionPatternParser().ParseActionCondition(condition); - var expected = new ParsedModRewriteInput { ConditionType = cond, OperationType = operation, Invert = false }; + var expected = new ParsedModRewriteInput { ConditionType = (ConditionType)cond, OperationType = (OperationType)operation, Invert = false }; Assert.True(CompareConditions(expected, results)); } [Theory] - [InlineData("!-d", OperationType.Directory, ConditionType.PropertyTest)] - [InlineData("!-f", OperationType.RegularFile, ConditionType.PropertyTest)] - [InlineData("!-F", OperationType.ExistingFile, ConditionType.PropertyTest)] - [InlineData("!-h", OperationType.SymbolicLink, ConditionType.PropertyTest)] - [InlineData("!-L", OperationType.SymbolicLink, ConditionType.PropertyTest)] - [InlineData("!-l", OperationType.SymbolicLink, ConditionType.PropertyTest)] - [InlineData("!-s", OperationType.Size, ConditionType.PropertyTest)] - [InlineData("!-U", OperationType.ExistingUrl, ConditionType.PropertyTest)] - [InlineData("!-x", OperationType.Executable, ConditionType.PropertyTest)] - public void ConditionPatternParser_CheckFileOperationsInverted(string condition, OperationType operation, ConditionType cond) + [InlineData("!-d", (int)OperationType.Directory, (int)ConditionType.PropertyTest)] + [InlineData("!-f", (int)OperationType.RegularFile, (int)ConditionType.PropertyTest)] + [InlineData("!-F", (int)OperationType.ExistingFile, (int)ConditionType.PropertyTest)] + [InlineData("!-h", (int)OperationType.SymbolicLink, (int)ConditionType.PropertyTest)] + [InlineData("!-L", (int)OperationType.SymbolicLink, (int)ConditionType.PropertyTest)] + [InlineData("!-l", (int)OperationType.SymbolicLink, (int)ConditionType.PropertyTest)] + [InlineData("!-s", (int)OperationType.Size, (int)ConditionType.PropertyTest)] + [InlineData("!-U", (int)OperationType.ExistingUrl, (int)ConditionType.PropertyTest)] + [InlineData("!-x", (int)OperationType.Executable, (int)ConditionType.PropertyTest)] + public void ConditionPatternParser_CheckFileOperationsInverted(string condition, int operation, int cond) { var results = new ConditionPatternParser().ParseActionCondition(condition); - var expected = new ParsedModRewriteInput { ConditionType = cond, OperationType = operation, Invert = true }; + var expected = new ParsedModRewriteInput { ConditionType = (ConditionType)cond, OperationType = (OperationType)operation, Invert = true }; Assert.True(CompareConditions(expected, results)); } [Theory] - [InlineData("-gt1", OperationType.Greater, "1", ConditionType.IntComp)] - [InlineData("-lt1", OperationType.Less, "1", ConditionType.IntComp)] - [InlineData("-ge1", OperationType.GreaterEqual, "1", ConditionType.IntComp)] - [InlineData("-le1", OperationType.LessEqual, "1", ConditionType.IntComp)] - [InlineData("-eq1", OperationType.Equal, "1", ConditionType.IntComp)] - [InlineData("-ne1", OperationType.NotEqual, "1", ConditionType.IntComp)] - public void ConditionPatternParser_CheckIntComp(string condition, OperationType operation, string variable, ConditionType cond) + [InlineData("-gt1", (int)OperationType.Greater, "1", (int)ConditionType.IntComp)] + [InlineData("-lt1", (int)OperationType.Less, "1", (int)ConditionType.IntComp)] + [InlineData("-ge1", (int)OperationType.GreaterEqual, "1", (int)ConditionType.IntComp)] + [InlineData("-le1", (int)OperationType.LessEqual, "1", (int)ConditionType.IntComp)] + [InlineData("-eq1", (int)OperationType.Equal, "1", (int)ConditionType.IntComp)] + [InlineData("-ne1", (int)OperationType.NotEqual, "1", (int)ConditionType.IntComp)] + public void ConditionPatternParser_CheckIntComp(string condition, int operation, string variable, int cond) { var results = new ConditionPatternParser().ParseActionCondition(condition); - var expected = new ParsedModRewriteInput { ConditionType = cond, OperationType = operation, Invert = false, Operand = variable }; + var expected = new ParsedModRewriteInput { ConditionType = (ConditionType)cond, OperationType = (OperationType)operation, Invert = false, Operand = variable }; Assert.True(CompareConditions(expected, results)); } diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/CookieActionFactoryTest.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/CookieActionFactoryTest.cs index d992eb7937..dd6501bf97 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/CookieActionFactoryTest.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/CookieActionFactoryTest.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Test diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/FlagParserTest.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/FlagParserTest.cs index bfb4c6420f..bad4b598b9 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/FlagParserTest.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/FlagParserTest.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/FormatExceptionTests.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/FormatExceptionTests.cs index 20db752b1f..44066bcfd1 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/FormatExceptionTests.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/FormatExceptionTests.cs @@ -3,7 +3,7 @@ using System; using System.IO; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/RewriteTokenizerTest.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/RewriteTokenizerTest.cs index 04a7071d7b..0d192e2fe5 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/RewriteTokenizerTest.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/RewriteTokenizerTest.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/RuleBuilderTest.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/RuleBuilderTest.cs index ec0b46803f..fe63d9afe6 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/RuleBuilderTest.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/RuleBuilderTest.cs @@ -4,9 +4,8 @@ using System; using System.Collections.Generic; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.UrlActions; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/RuleRegexParserTest.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/RuleRegexParserTest.cs index 20f54abba5..9af8163bf2 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/RuleRegexParserTest.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/RuleRegexParserTest.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite diff --git a/src/Middleware/Rewrite/test/ApacheModRewrite/TestStringParserTests.cs b/src/Middleware/Rewrite/test/ApacheModRewrite/TestStringParserTests.cs index eafb814ab1..3968c9e403 100644 --- a/src/Middleware/Rewrite/test/ApacheModRewrite/TestStringParserTests.cs +++ b/src/Middleware/Rewrite/test/ApacheModRewrite/TestStringParserTests.cs @@ -3,9 +3,8 @@ using System; using System.Collections.Generic; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.ApacheModRewrite; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.ApacheModRewrite; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.ModRewrite diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/FileParserTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/FileParserTests.cs index f6ad788aca..1949e773c8 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/FileParserTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/FileParserTests.cs @@ -4,10 +4,9 @@ using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlMatches; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/FormatExceptionHandlingTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/FormatExceptionHandlingTests.cs index 20ad022d5a..17cd5900d5 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/FormatExceptionHandlingTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/FormatExceptionHandlingTests.cs @@ -3,7 +3,7 @@ using System; using System.IO; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/InputParserTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/InputParserTests.cs index 0439bc4fa0..a737da083f 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/InputParserTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/InputParserTests.cs @@ -5,9 +5,8 @@ using System; using System.Linq; using System.Text.RegularExpressions; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Microsoft.Extensions.Logging.Abstractions; using Xunit; diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/InvalidUrlRewriteFormatExceptionHandlingTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/InvalidUrlRewriteFormatExceptionHandlingTests.cs index 4f6e77d01b..3784e692c9 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/InvalidUrlRewriteFormatExceptionHandlingTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/InvalidUrlRewriteFormatExceptionHandlingTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/MiddleWareTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/MiddleWareTests.cs index ce146b1df1..35df2b5c56 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/MiddleWareTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/MiddleWareTests.cs @@ -11,10 +11,9 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlMatches; using Microsoft.AspNetCore.TestHost; using Microsoft.Net.Http.Headers; using Xunit; @@ -553,9 +552,9 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite } [Theory] - [InlineData(@"^http://localhost(/.*)", "http://localhost/foo/bar", UriMatchPart.Path)] - [InlineData(@"^http://localhost(/.*)", "http://www.test.com/foo/bar", UriMatchPart.Full)] - public async Task Invoke_GlobalRuleConditionMatchesAgainstFullUri_CodedRule(string conditionInputPattern, string expectedResult, UriMatchPart uriMatchPart) + [InlineData(@"^http://localhost(/.*)", "http://localhost/foo/bar", (int)UriMatchPart.Path)] + [InlineData(@"^http://localhost(/.*)", "http://www.test.com/foo/bar", (int)UriMatchPart.Full)] + public async Task Invoke_GlobalRuleConditionMatchesAgainstFullUri_CodedRule(string conditionInputPattern, string expectedResult, int uriMatchPart) { // arrange var inputParser = new InputParser(); @@ -571,7 +570,7 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite inputParser, "{REQUEST_URI}", conditionInputPattern, - uriMatchPart, + (UriMatchPart)uriMatchPart, ignoreCase: true, negate: false); ruleBuilder.ConfigureConditionBehavior(LogicalGrouping.MatchAll, trackAllCaptures: true); @@ -579,7 +578,7 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite var action = new RewriteAction( RuleResult.SkipRemainingRules, - inputParser.ParseInputString(@"http://www.test.com{C:1}", uriMatchPart), + inputParser.ParseInputString(@"http://www.test.com{C:1}", (UriMatchPart)uriMatchPart), queryStringAppend: false); ruleBuilder.AddUrlAction(action); diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/RewriteMapParserTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/RewriteMapParserTests.cs index a917e675f7..f100eea479 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/RewriteMapParserTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/RewriteMapParserTests.cs @@ -4,7 +4,7 @@ using System.IO; using System.Linq; using System.Xml.Linq; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.IISUrlRewrite diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/ServerVariableTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/ServerVariableTests.cs index 274ef848e5..d4aedd866c 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/ServerVariableTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/ServerVariableTests.cs @@ -5,8 +5,8 @@ using System.Collections.Generic; using System.Text.RegularExpressions; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; using Microsoft.Net.Http.Headers; using Xunit; @@ -15,52 +15,52 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.IISUrlRewrite public class ServerVariableTests { [Theory] - [InlineData("CONTENT_LENGTH", "10", UriMatchPart.Path)] - [InlineData("CONTENT_TYPE", "json", UriMatchPart.Path)] - [InlineData("HTTP_ACCEPT", "accept", UriMatchPart.Path)] - [InlineData("HTTP_COOKIE", "cookie", UriMatchPart.Path)] - [InlineData("HTTP_HOST", "example.com", UriMatchPart.Path)] - [InlineData("HTTP_REFERER", "referer", UriMatchPart.Path)] - [InlineData("HTTP_USER_AGENT", "useragent", UriMatchPart.Path)] - [InlineData("HTTP_CONNECTION", "connection", UriMatchPart.Path)] - [InlineData("HTTP_URL", "/foo", UriMatchPart.Path)] - [InlineData("HTTP_URL", "http://example.com/foo?bar=1", UriMatchPart.Full)] - [InlineData("QUERY_STRING", "bar=1", UriMatchPart.Path)] - [InlineData("REQUEST_FILENAME", "/foo", UriMatchPart.Path)] - [InlineData("REQUEST_URI", "/foo", UriMatchPart.Path)] - [InlineData("REQUEST_URI", "http://example.com/foo?bar=1", UriMatchPart.Full)] - [InlineData("REQUEST_METHOD", "GET", UriMatchPart.Full)] - public void CheckServerVariableParsingAndApplication(string variable, string expected, UriMatchPart uriMatchPart) + [InlineData("CONTENT_LENGTH", "10", (int)UriMatchPart.Path)] + [InlineData("CONTENT_TYPE", "json", (int)UriMatchPart.Path)] + [InlineData("HTTP_ACCEPT", "accept", (int)UriMatchPart.Path)] + [InlineData("HTTP_COOKIE", "cookie", (int)UriMatchPart.Path)] + [InlineData("HTTP_HOST", "example.com", (int)UriMatchPart.Path)] + [InlineData("HTTP_REFERER", "referer", (int)UriMatchPart.Path)] + [InlineData("HTTP_USER_AGENT", "useragent", (int)UriMatchPart.Path)] + [InlineData("HTTP_CONNECTION", "connection", (int)UriMatchPart.Path)] + [InlineData("HTTP_URL", "/foo", (int)UriMatchPart.Path)] + [InlineData("HTTP_URL", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] + [InlineData("QUERY_STRING", "bar=1", (int)UriMatchPart.Path)] + [InlineData("REQUEST_FILENAME", "/foo", (int)UriMatchPart.Path)] + [InlineData("REQUEST_URI", "/foo", (int)UriMatchPart.Path)] + [InlineData("REQUEST_URI", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] + [InlineData("REQUEST_METHOD", "GET", (int)UriMatchPart.Full)] + public void CheckServerVariableParsingAndApplication(string variable, string expected, int uriMatchPart) { // Arrange and Act var testParserContext = new ParserContext("test"); - var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, uriMatchPart, true); + var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, (UriMatchPart)uriMatchPart, true); var lookup = serverVar.Evaluate(CreateTestRewriteContext(), CreateTestRuleMatch().BackReferences, CreateTestCondMatch().BackReferences); // Assert Assert.Equal(expected, lookup); } [Theory] - [InlineData("CONTENT_LENGTH", "20", UriMatchPart.Path)] - [InlineData("CONTENT_TYPE", "text/xml", UriMatchPart.Path)] - [InlineData("HTTP_ACCEPT", "other-accept", UriMatchPart.Path)] - [InlineData("HTTP_COOKIE", "other-cookie", UriMatchPart.Path)] - [InlineData("HTTP_HOST", "otherexample.com", UriMatchPart.Path)] - [InlineData("HTTP_REFERER", "other-referer", UriMatchPart.Path)] - [InlineData("HTTP_USER_AGENT", "other-useragent", UriMatchPart.Path)] - [InlineData("HTTP_CONNECTION", "other-connection", UriMatchPart.Path)] - [InlineData("HTTP_URL", "http://otherexample.com/other-foo?bar=2", UriMatchPart.Full)] - [InlineData("HTTP_URL", "http://otherexample.com/other-foo?bar=2", UriMatchPart.Path)] - [InlineData("QUERY_STRING", "bar=2", UriMatchPart.Path)] - [InlineData("REQUEST_FILENAME", "/other-foo", UriMatchPart.Path)] - [InlineData("REQUEST_URI", "/other-foo", UriMatchPart.Path)] - [InlineData("REQUEST_URI", "/other-foo", UriMatchPart.Full)] - [InlineData("REQUEST_METHOD", "POST", UriMatchPart.Full)] - public void CheckServerVariableFeatureHasPrecedenceWhenEnabled(string variable, string expected, UriMatchPart uriMatchPart) + [InlineData("CONTENT_LENGTH", "20", (int)UriMatchPart.Path)] + [InlineData("CONTENT_TYPE", "text/xml", (int)UriMatchPart.Path)] + [InlineData("HTTP_ACCEPT", "other-accept", (int)UriMatchPart.Path)] + [InlineData("HTTP_COOKIE", "other-cookie", (int)UriMatchPart.Path)] + [InlineData("HTTP_HOST", "otherexample.com", (int)UriMatchPart.Path)] + [InlineData("HTTP_REFERER", "other-referer", (int)UriMatchPart.Path)] + [InlineData("HTTP_USER_AGENT", "other-useragent", (int)UriMatchPart.Path)] + [InlineData("HTTP_CONNECTION", "other-connection", (int)UriMatchPart.Path)] + [InlineData("HTTP_URL", "http://otherexample.com/other-foo?bar=2", (int)UriMatchPart.Full)] + [InlineData("HTTP_URL", "http://otherexample.com/other-foo?bar=2", (int)UriMatchPart.Path)] + [InlineData("QUERY_STRING", "bar=2", (int)UriMatchPart.Path)] + [InlineData("REQUEST_FILENAME", "/other-foo", (int)UriMatchPart.Path)] + [InlineData("REQUEST_URI", "/other-foo", (int)UriMatchPart.Path)] + [InlineData("REQUEST_URI", "/other-foo", (int)UriMatchPart.Full)] + [InlineData("REQUEST_METHOD", "POST", (int)UriMatchPart.Full)] + public void CheckServerVariableFeatureHasPrecedenceWhenEnabled(string variable, string expected, int uriMatchPart) { // Arrange and Act var testParserContext = new ParserContext("test"); - var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, uriMatchPart, false); + var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, (UriMatchPart)uriMatchPart, false); var httpContext = CreateTestHttpContext(); httpContext.Features.Set(new TestServerVariablesFeature(new Dictionary { @@ -87,26 +87,26 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.IISUrlRewrite } [Theory] - [InlineData("CONTENT_LENGTH", "10", UriMatchPart.Path)] - [InlineData("CONTENT_TYPE", "json", UriMatchPart.Path)] - [InlineData("HTTP_ACCEPT", "accept", UriMatchPart.Path)] - [InlineData("HTTP_COOKIE", "cookie", UriMatchPart.Path)] - [InlineData("HTTP_HOST", "example.com", UriMatchPart.Path)] - [InlineData("HTTP_REFERER", "referer", UriMatchPart.Path)] - [InlineData("HTTP_USER_AGENT", "useragent", UriMatchPart.Path)] - [InlineData("HTTP_CONNECTION", "connection", UriMatchPart.Path)] - [InlineData("HTTP_URL", "/foo", UriMatchPart.Path)] - [InlineData("HTTP_URL", "http://example.com/foo?bar=1", UriMatchPart.Full)] - [InlineData("QUERY_STRING", "bar=1", UriMatchPart.Path)] - [InlineData("REQUEST_FILENAME", "/foo", UriMatchPart.Path)] - [InlineData("REQUEST_URI", "/foo", UriMatchPart.Path)] - [InlineData("REQUEST_URI", "http://example.com/foo?bar=1", UriMatchPart.Full)] - [InlineData("REQUEST_METHOD", "GET", UriMatchPart.Full)] - public void CheckServerVariableFeatureIsntUsedWhenDisabled(string variable, string expected, UriMatchPart uriMatchPart) + [InlineData("CONTENT_LENGTH", "10", (int)UriMatchPart.Path)] + [InlineData("CONTENT_TYPE", "json", (int)UriMatchPart.Path)] + [InlineData("HTTP_ACCEPT", "accept", (int)UriMatchPart.Path)] + [InlineData("HTTP_COOKIE", "cookie", (int)UriMatchPart.Path)] + [InlineData("HTTP_HOST", "example.com", (int)UriMatchPart.Path)] + [InlineData("HTTP_REFERER", "referer", (int)UriMatchPart.Path)] + [InlineData("HTTP_USER_AGENT", "useragent", (int)UriMatchPart.Path)] + [InlineData("HTTP_CONNECTION", "connection", (int)UriMatchPart.Path)] + [InlineData("HTTP_URL", "/foo", (int)UriMatchPart.Path)] + [InlineData("HTTP_URL", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] + [InlineData("QUERY_STRING", "bar=1", (int)UriMatchPart.Path)] + [InlineData("REQUEST_FILENAME", "/foo", (int)UriMatchPart.Path)] + [InlineData("REQUEST_URI", "/foo", (int)UriMatchPart.Path)] + [InlineData("REQUEST_URI", "http://example.com/foo?bar=1", (int)UriMatchPart.Full)] + [InlineData("REQUEST_METHOD", "GET", (int)UriMatchPart.Full)] + public void CheckServerVariableFeatureIsntUsedWhenDisabled(string variable, string expected, int uriMatchPart) { // Arrange and Act var testParserContext = new ParserContext("test"); - var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, uriMatchPart, true); + var serverVar = ServerVariables.FindServerVariable(variable, testParserContext, (UriMatchPart)uriMatchPart, true); var httpContext = CreateTestHttpContext(); httpContext.Features.Set(new TestServerVariablesFeature(new Dictionary { diff --git a/src/Middleware/Rewrite/test/IISUrlRewrite/UrlRewriteApplicationTests.cs b/src/Middleware/Rewrite/test/IISUrlRewrite/UrlRewriteApplicationTests.cs index d1b9a83936..c78a4787e8 100644 --- a/src/Middleware/Rewrite/test/IISUrlRewrite/UrlRewriteApplicationTests.cs +++ b/src/Middleware/Rewrite/test/IISUrlRewrite/UrlRewriteApplicationTests.cs @@ -4,7 +4,7 @@ using System.IO; using System.Linq; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite diff --git a/src/Middleware/Rewrite/test/PatternSegments/ConditionMatchSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/ConditionMatchSegmentTests.cs index a67113954f..e568636304 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/ConditionMatchSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/ConditionMatchSegmentTests.cs @@ -2,8 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/DateTimeSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/DateTimeSegmentTests.cs index 8f5ef184a8..2e142567a6 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/DateTimeSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/DateTimeSegmentTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/HeaderSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/HeaderSegmentTests.cs index b8472929b7..9f53cd5254 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/HeaderSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/HeaderSegmentTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Microsoft.Net.Http.Headers; using Xunit; diff --git a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs index b578b31bac..bd14c17372 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsModSegmentTests.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs index 789f94e670..2990ebe011 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/IsHttpsSegmentTests.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs index c787998e9c..3fe803be00 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/IsIPV6SegmentTests.cs @@ -4,7 +4,7 @@ using System.Net; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/LIteralSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/LIteralSegmentTests.cs index 1bf3e74fee..5269ab07de 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/LIteralSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/LIteralSegmentTests.cs @@ -1,7 +1,7 @@ // 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.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs index 07d7254574..a9f26d3373 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/LocalAddressSegmentTests.cs @@ -4,7 +4,7 @@ using System.Net; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs index 1a3dad1896..7dae569646 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/LocalPortSegmentTests.cs @@ -4,7 +4,7 @@ using System.Globalization; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/QueryStringSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/QueryStringSegmentTests.cs index 3e7190ef9d..09ad2e4d69 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/QueryStringSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/QueryStringSegmentTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/RemoteAddressSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/RemoteAddressSegmentTests.cs index c7f5ede0dc..ec0316535a 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/RemoteAddressSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/RemoteAddressSegmentTests.cs @@ -3,7 +3,7 @@ using System.Net; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/RemotePortSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/RemotePortSegmentTests.cs index 6980e2379f..fd016fcd6e 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/RemotePortSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/RemotePortSegmentTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/RequestFilenameSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/RequestFilenameSegmentTests.cs index 16e051d7af..c4f90e5cae 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/RequestFilenameSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/RequestFilenameSegmentTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/RequestMethodSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/RequestMethodSegmentTests.cs index 0fa65a8182..c86ade7db9 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/RequestMethodSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/RequestMethodSegmentTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/RuleMatchSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/RuleMatchSegmentTests.cs index 56189c9bee..a7add81115 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/RuleMatchSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/RuleMatchSegmentTests.cs @@ -2,8 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/SchemeSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/SchemeSegmentTests.cs index 3caac305c6..c60463c5a0 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/SchemeSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/SchemeSegmentTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/ServerProtocolSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/ServerProtocolSegmentTests.cs index 9128ef6b32..c1ec80de68 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/ServerProtocolSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/ServerProtocolSegmentTests.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/ToLowerSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/ToLowerSegmentTests.cs index a6b434ff3d..be274a57d0 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/ToLowerSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/ToLowerSegmentTests.cs @@ -2,8 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/UrlEncodeSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/UrlEncodeSegmentTests.cs index 767876a9a5..cf3c65c5e8 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/UrlEncodeSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/UrlEncodeSegmentTests.cs @@ -2,8 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments diff --git a/src/Middleware/Rewrite/test/PatternSegments/UrlSegmentTests.cs b/src/Middleware/Rewrite/test/PatternSegments/UrlSegmentTests.cs index e85c5662b4..cf513624a1 100644 --- a/src/Middleware/Rewrite/test/PatternSegments/UrlSegmentTests.cs +++ b/src/Middleware/Rewrite/test/PatternSegments/UrlSegmentTests.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite; -using Microsoft.AspNetCore.Rewrite.Internal.PatternSegments; +using Microsoft.AspNetCore.Rewrite.IISUrlRewrite; +using Microsoft.AspNetCore.Rewrite.PatternSegments; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments @@ -11,19 +11,19 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments public class UrlSegmentTests { [Theory] - [InlineData("http", "localhost", 80, null, UriMatchPart.Path, "")] - [InlineData("http", "localhost", 80, "", UriMatchPart.Path, "")] - [InlineData("http", "localhost", 80, "/foo/bar", UriMatchPart.Path, "/foo/bar")] - [InlineData("http", "localhost", 80, "/foo:bar", UriMatchPart.Path, "/foo:bar")] - [InlineData("http", "localhost", 80, "/foo bar", UriMatchPart.Path, "/foo%20bar")] - [InlineData("http", "localhost", 80, null, UriMatchPart.Full, "http://localhost:80/")] - [InlineData("http", "localhost", 80, "", UriMatchPart.Full, "http://localhost:80/")] - [InlineData("http", "localhost", 80, "/foo:bar", UriMatchPart.Full, "http://localhost:80/foo:bar")] - [InlineData("http", "localhost", 80, "/foo bar", UriMatchPart.Full, "http://localhost:80/foo%20bar")] - [InlineData("http", "localhost", 80, "/foo/bar", UriMatchPart.Full, "http://localhost:80/foo/bar")] - [InlineData("http", "localhost", 81, "/foo/bar", UriMatchPart.Full, "http://localhost:81/foo/bar")] - [InlineData("https", "localhost", 443, "/foo/bar", UriMatchPart.Full, "https://localhost:443/foo/bar")] - public void AssertSegmentIsCorrect(string scheme, string host, int port, string path, UriMatchPart uriMatchPart, string expectedResult) + [InlineData("http", "localhost", 80, null, (int)UriMatchPart.Path, "")] + [InlineData("http", "localhost", 80, "", (int)UriMatchPart.Path, "")] + [InlineData("http", "localhost", 80, "/foo/bar", (int)UriMatchPart.Path, "/foo/bar")] + [InlineData("http", "localhost", 80, "/foo:bar", (int)UriMatchPart.Path, "/foo:bar")] + [InlineData("http", "localhost", 80, "/foo bar", (int)UriMatchPart.Path, "/foo%20bar")] + [InlineData("http", "localhost", 80, null, (int)UriMatchPart.Full, "http://localhost:80/")] + [InlineData("http", "localhost", 80, "", (int)UriMatchPart.Full, "http://localhost:80/")] + [InlineData("http", "localhost", 80, "/foo:bar", (int)UriMatchPart.Full, "http://localhost:80/foo:bar")] + [InlineData("http", "localhost", 80, "/foo bar", (int)UriMatchPart.Full, "http://localhost:80/foo%20bar")] + [InlineData("http", "localhost", 80, "/foo/bar", (int)UriMatchPart.Full, "http://localhost:80/foo/bar")] + [InlineData("http", "localhost", 81, "/foo/bar", (int)UriMatchPart.Full, "http://localhost:81/foo/bar")] + [InlineData("https", "localhost", 443, "/foo/bar", (int)UriMatchPart.Full, "https://localhost:443/foo/bar")] + public void AssertSegmentIsCorrect(string scheme, string host, int port, string path, int uriMatchPart, string expectedResult) { // Arrange var httpContext = new DefaultHttpContext(); @@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments context.HttpContext = httpContext; // Act - var segment = new UrlSegment(uriMatchPart); + var segment = new UrlSegment((UriMatchPart)uriMatchPart); var results = segment.Evaluate(context, null, null); // Assert diff --git a/src/Middleware/Rewrite/test/UrlActions/AbortActionTests.cs b/src/Middleware/Rewrite/test/UrlActions/AbortActionTests.cs index e39e58fb84..654be9d3e5 100644 --- a/src/Middleware/Rewrite/test/UrlActions/AbortActionTests.cs +++ b/src/Middleware/Rewrite/test/UrlActions/AbortActionTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlActions; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlActions diff --git a/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs b/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs index 20096ef162..38365f7034 100644 --- a/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs +++ b/src/Middleware/Rewrite/test/UrlActions/ChangeCookieActionTests.cs @@ -3,7 +3,7 @@ using System; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlActions; using Microsoft.Net.Http.Headers; using Xunit; diff --git a/src/Middleware/Rewrite/test/UrlActions/ForbiddenActionTests.cs b/src/Middleware/Rewrite/test/UrlActions/ForbiddenActionTests.cs index a9eac5a807..1dd8368792 100644 --- a/src/Middleware/Rewrite/test/UrlActions/ForbiddenActionTests.cs +++ b/src/Middleware/Rewrite/test/UrlActions/ForbiddenActionTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlActions; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlActions diff --git a/src/Middleware/Rewrite/test/UrlActions/GoneActionTests.cs b/src/Middleware/Rewrite/test/UrlActions/GoneActionTests.cs index 00720f85ef..b617332015 100644 --- a/src/Middleware/Rewrite/test/UrlActions/GoneActionTests.cs +++ b/src/Middleware/Rewrite/test/UrlActions/GoneActionTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlActions; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlActions diff --git a/src/Middleware/Rewrite/test/UrlMatches/ExactMatchTests.cs b/src/Middleware/Rewrite/test/UrlMatches/ExactMatchTests.cs index 7f7e82b9b2..94fb2f4aa3 100644 --- a/src/Middleware/Rewrite/test/UrlMatches/ExactMatchTests.cs +++ b/src/Middleware/Rewrite/test/UrlMatches/ExactMatchTests.cs @@ -2,9 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; +using Microsoft.AspNetCore.Rewrite.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlMatches; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlMatches diff --git a/src/Middleware/Rewrite/test/UrlMatches/IntegerMatchTests.cs b/src/Middleware/Rewrite/test/UrlMatches/IntegerMatchTests.cs index 5dd87ca4ad..5979ed6835 100644 --- a/src/Middleware/Rewrite/test/UrlMatches/IntegerMatchTests.cs +++ b/src/Middleware/Rewrite/test/UrlMatches/IntegerMatchTests.cs @@ -4,9 +4,8 @@ using System; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite; -using Microsoft.AspNetCore.Rewrite.Internal; -using Microsoft.AspNetCore.Rewrite.Internal.UrlActions; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; +using Microsoft.AspNetCore.Rewrite.UrlActions; +using Microsoft.AspNetCore.Rewrite.UrlMatches; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlMatches @@ -21,19 +20,19 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.UrlMatches } [Theory] - [InlineData(1,IntegerOperationType.Equal,"1",true)] - [InlineData(1, IntegerOperationType.NotEqual, "2", true)] - [InlineData(2, IntegerOperationType.Less, "1", true)] - [InlineData(1, IntegerOperationType.LessEqual, "2", false)] - [InlineData(1, IntegerOperationType.Greater, "2", true)] - [InlineData(2, IntegerOperationType.GreaterEqual, "1", false)] - [InlineData(1, IntegerOperationType.Equal, "Not an int", false)] - [InlineData(1, IntegerOperationType.Equal, "", false)] - [InlineData(1, IntegerOperationType.Equal, "2147483648", false)] - public void IntegerMatch_Evaluation_Cases_Tests(int value,IntegerOperationType operation, string input,bool expectedResult) + [InlineData(1, (int)IntegerOperationType.Equal,"1",true)] + [InlineData(1, (int)IntegerOperationType.NotEqual, "2", true)] + [InlineData(2, (int)IntegerOperationType.Less, "1", true)] + [InlineData(1, (int)IntegerOperationType.LessEqual, "2", false)] + [InlineData(1, (int)IntegerOperationType.Greater, "2", true)] + [InlineData(2, (int)IntegerOperationType.GreaterEqual, "1", false)] + [InlineData(1, (int)IntegerOperationType.Equal, "Not an int", false)] + [InlineData(1, (int)IntegerOperationType.Equal, "", false)] + [InlineData(1, (int)IntegerOperationType.Equal, "2147483648", false)] + public void IntegerMatch_Evaluation_Cases_Tests(int value, int operation, string input, bool expectedResult) { var context = new RewriteContext { HttpContext = new DefaultHttpContext() }; - var integerMatch = new IntegerMatch(value, operation); + var integerMatch = new IntegerMatch(value, (IntegerOperationType)operation); var matchResult = integerMatch.Evaluate(input, context); Assert.Equal(expectedResult, matchResult.Success); } diff --git a/src/Middleware/Rewrite/test/UrlMatches/StringMatchTests.cs b/src/Middleware/Rewrite/test/UrlMatches/StringMatchTests.cs index a562fec6e2..857bdfc043 100644 --- a/src/Middleware/Rewrite/test/UrlMatches/StringMatchTests.cs +++ b/src/Middleware/Rewrite/test/UrlMatches/StringMatchTests.cs @@ -1,9 +1,9 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Rewrite.Internal.UrlMatches; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Rewrite.UrlMatches; using Xunit; namespace Microsoft.AspNetCore.Rewrite.Tests.UrlMatches @@ -11,17 +11,17 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.UrlMatches public class StringMatchTests { [Theory] - [InlineData("hi", StringOperationType.Equal,true,"hi",true)] - [InlineData("a", StringOperationType.Greater, true, "b", true)] - [InlineData("a", StringOperationType.GreaterEqual, true, "b", true)] - [InlineData("b", StringOperationType.Less,true, "a", true)] - [InlineData("b", StringOperationType.LessEqual, true, "a", true)] - [InlineData("", StringOperationType.Equal, true, "", true)] - [InlineData(null, StringOperationType.Equal, true, null, true)] - public void StringMatch_Evaluation_Check_Cases(string value, StringOperationType operation, bool ignoreCase, string input, bool expectedResult) + [InlineData("hi", (int)StringOperationType.Equal,true,"hi",true)] + [InlineData("a", (int)StringOperationType.Greater, true, "b", true)] + [InlineData("a", (int)StringOperationType.GreaterEqual, true, "b", true)] + [InlineData("b", (int)StringOperationType.Less,true, "a", true)] + [InlineData("b", (int)StringOperationType.LessEqual, true, "a", true)] + [InlineData("", (int)StringOperationType.Equal, true, "", true)] + [InlineData(null, (int)StringOperationType.Equal, true, null, true)] + public void StringMatch_Evaluation_Check_Cases(string value, int operation, bool ignoreCase, string input, bool expectedResult) { var context = new RewriteContext { HttpContext = new DefaultHttpContext() }; - var stringMatch = new StringMatch(value, operation, ignoreCase); + var stringMatch = new StringMatch(value, (StringOperationType)operation, ignoreCase); var matchResult = stringMatch.Evaluate(input, context); Assert.Equal(expectedResult, matchResult.Success); } diff --git a/src/Middleware/WebSockets/src/Internal/Constants.cs b/src/Middleware/WebSockets/src/Constants.cs similarity index 90% rename from src/Middleware/WebSockets/src/Internal/Constants.cs rename to src/Middleware/WebSockets/src/Constants.cs index 8fb17cf9c0..6208d4914a 100644 --- a/src/Middleware/WebSockets/src/Internal/Constants.cs +++ b/src/Middleware/WebSockets/src/Constants.cs @@ -1,7 +1,7 @@ // 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. -namespace Microsoft.AspNetCore.WebSockets.Internal +namespace Microsoft.AspNetCore.WebSockets { internal static class Constants { diff --git a/src/Middleware/WebSockets/src/Internal/HandshakeHelpers.cs b/src/Middleware/WebSockets/src/HandshakeHelpers.cs similarity index 98% rename from src/Middleware/WebSockets/src/Internal/HandshakeHelpers.cs rename to src/Middleware/WebSockets/src/HandshakeHelpers.cs index 551ca879c9..0162751f16 100644 --- a/src/Middleware/WebSockets/src/Internal/HandshakeHelpers.cs +++ b/src/Middleware/WebSockets/src/HandshakeHelpers.cs @@ -8,7 +8,7 @@ using System.Text; using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.WebSockets.Internal +namespace Microsoft.AspNetCore.WebSockets { internal static class HandshakeHelpers { diff --git a/src/Middleware/WebSockets/src/WebSocketMiddleware.cs b/src/Middleware/WebSockets/src/WebSocketMiddleware.cs index 28f7f3a232..bff8a770d2 100644 --- a/src/Middleware/WebSockets/src/WebSocketMiddleware.cs +++ b/src/Middleware/WebSockets/src/WebSocketMiddleware.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.WebSockets.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; diff --git a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs index 61b310f1b0..a997c88214 100644 --- a/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs +++ b/src/Middleware/WebSockets/test/UnitTests/WebSocketMiddlewareTests.cs @@ -10,7 +10,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Testing; using Microsoft.AspNetCore.Testing.xunit; -using Microsoft.AspNetCore.WebSockets.Internal; using Microsoft.Extensions.Logging.Testing; using Microsoft.Net.Http.Headers; using Xunit; diff --git a/src/Middleware/WebSockets/test/UnitTests/WebSocketPair.cs b/src/Middleware/WebSockets/test/UnitTests/WebSocketPair.cs index d3050538a0..efb11af60c 100644 --- a/src/Middleware/WebSockets/test/UnitTests/WebSocketPair.cs +++ b/src/Middleware/WebSockets/test/UnitTests/WebSocketPair.cs @@ -1,6 +1,5 @@ using System; using System.Net.WebSockets; -using Microsoft.AspNetCore.WebSockets.Internal; namespace Microsoft.AspNetCore.WebSockets.Test { diff --git a/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs b/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs index feeba2cc12..a895709b24 100644 --- a/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs +++ b/src/Mvc/Mvc.Core/ref/Microsoft.AspNetCore.Mvc.Core.netcoreapp3.0.cs @@ -875,6 +875,7 @@ namespace Microsoft.AspNetCore.Mvc public Microsoft.AspNetCore.Mvc.Filters.FilterCollection Filters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public Microsoft.AspNetCore.Mvc.Formatters.FormatterMappings FormatterMappings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } public Microsoft.AspNetCore.Mvc.Formatters.FormatterCollection InputFormatters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public int MaxIAsyncEnumerableBufferLimit { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } public int MaxModelBindingCollectionSize { get { throw null; } set { } } public int MaxModelBindingRecursionDepth { get { throw null; } set { } } public int MaxModelValidationErrors { get { throw null; } set { } } @@ -2086,7 +2087,9 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure } public partial class ObjectResultExecutor : Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor { + [System.ObsoleteAttribute("This constructor is obsolete and will be removed in a future release.")] public ObjectResultExecutor(Microsoft.AspNetCore.Mvc.Infrastructure.OutputFormatterSelector formatterSelector, Microsoft.AspNetCore.Mvc.Infrastructure.IHttpResponseStreamWriterFactory writerFactory, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { } + public ObjectResultExecutor(Microsoft.AspNetCore.Mvc.Infrastructure.OutputFormatterSelector formatterSelector, Microsoft.AspNetCore.Mvc.Infrastructure.IHttpResponseStreamWriterFactory writerFactory, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.Extensions.Options.IOptions mvcOptions) { } protected Microsoft.AspNetCore.Mvc.Infrastructure.OutputFormatterSelector FormatterSelector { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } protected Microsoft.Extensions.Logging.ILogger Logger { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } protected System.Func WriterFactory { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/AsyncEnumerableReader.cs b/src/Mvc/Mvc.Core/src/Infrastructure/AsyncEnumerableReader.cs new file mode 100644 index 0000000000..846e8f19d5 --- /dev/null +++ b/src/Mvc/Mvc.Core/src/Infrastructure/AsyncEnumerableReader.cs @@ -0,0 +1,102 @@ +// 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.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.Reflection; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.Core; +using Microsoft.Extensions.Internal; + +#if JSONNET +namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson +#else +namespace Microsoft.AspNetCore.Mvc.Infrastructure +#endif +{ + using ReaderFunc = Func, Task>; + + /// + /// Type that reads an instance into a + /// generic collection instance. + /// + /// + /// This type is used to create a strongly typed synchronous instance from + /// an . An accurate is required for XML formatters to + /// correctly serialize. + /// + internal sealed class AsyncEnumerableReader + { + private readonly MethodInfo Converter = typeof(AsyncEnumerableReader).GetMethod( + nameof(ReadInternal), + BindingFlags.NonPublic | BindingFlags.Instance); + + private readonly ConcurrentDictionary _asyncEnumerableConverters = + new ConcurrentDictionary(); + private readonly MvcOptions _mvcOptions; + + /// + /// Initializes a new instance of . + /// + /// Accessor to . + public AsyncEnumerableReader(MvcOptions mvcOptions) + { + _mvcOptions = mvcOptions; + } + + /// + /// Reads a into an . + /// + /// The to read. + /// The . + public Task ReadAsync(IAsyncEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + var type = value.GetType(); + if (!_asyncEnumerableConverters.TryGetValue(type, out var result)) + { + var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(type, typeof(IAsyncEnumerable<>)); + Debug.Assert(enumerableType != null); + + var enumeratedObjectType = enumerableType.GetGenericArguments()[0]; + + var converter = (ReaderFunc)Converter + .MakeGenericMethod(enumeratedObjectType) + .CreateDelegate(typeof(ReaderFunc), this); + + _asyncEnumerableConverters.TryAdd(type, converter); + result = converter; + } + + return result(value); + } + + private async Task ReadInternal(IAsyncEnumerable value) + { + var asyncEnumerable = (IAsyncEnumerable)value; + var result = new List(); + var count = 0; + + await foreach (var item in asyncEnumerable) + { + if (count++ >= _mvcOptions.MaxIAsyncEnumerableBufferLimit) + { + throw new InvalidOperationException(Resources.FormatObjectResultExecutor_MaxEnumerationExceeded( + nameof(AsyncEnumerableReader), + value.GetType())); + } + + result.Add(item); + } + + return result; + } + } +} diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs b/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs index bafe6d239d..d26d7decb4 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs @@ -147,14 +147,11 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure } } - if (selectedFormatter == null) + if (selectedFormatter != null) { - // No formatter supports this. - _logger.NoFormatter(context); - return null; + _logger.FormatterSelected(selectedFormatter, context); } - _logger.FormatterSelected(selectedFormatter, context); return selectedFormatter; } diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs index 6c5179d222..8f2a40bbfc 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ObjectResultExecutor.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc.Infrastructure { @@ -18,16 +19,35 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure /// public class ObjectResultExecutor : IActionResultExecutor { + private readonly AsyncEnumerableReader _asyncEnumerableReader; + /// /// Creates a new . /// /// The . /// The . /// The . + [Obsolete("This constructor is obsolete and will be removed in a future release.")] public ObjectResultExecutor( OutputFormatterSelector formatterSelector, IHttpResponseStreamWriterFactory writerFactory, ILoggerFactory loggerFactory) + : this(formatterSelector, writerFactory, loggerFactory, mvcOptions: null) + { + } + + /// + /// Creates a new . + /// + /// The . + /// The . + /// The . + /// Accessor to . + public ObjectResultExecutor( + OutputFormatterSelector formatterSelector, + IHttpResponseStreamWriterFactory writerFactory, + ILoggerFactory loggerFactory, + IOptions mvcOptions) { if (formatterSelector == null) { @@ -47,6 +67,8 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure FormatterSelector = formatterSelector; WriterFactory = writerFactory.CreateWriter; Logger = loggerFactory.CreateLogger(); + var options = mvcOptions?.Value ?? throw new ArgumentNullException(nameof(mvcOptions)); + _asyncEnumerableReader = new AsyncEnumerableReader(options); } /// @@ -87,16 +109,37 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure InferContentTypes(context, result); var objectType = result.DeclaredType; + if (objectType == null || objectType == typeof(object)) { objectType = result.Value?.GetType(); } + var value = result.Value; + + if (value is IAsyncEnumerable asyncEnumerable) + { + return ExecuteAsyncEnumerable(context, result, asyncEnumerable); + } + + return ExecuteAsyncCore(context, result, objectType, value); + } + + private async Task ExecuteAsyncEnumerable(ActionContext context, ObjectResult result, IAsyncEnumerable asyncEnumerable) + { + Log.BufferingAsyncEnumerable(Logger, asyncEnumerable); + + var enumerated = await _asyncEnumerableReader.ReadAsync(asyncEnumerable); + await ExecuteAsyncCore(context, result, enumerated.GetType(), enumerated); + } + + private Task ExecuteAsyncCore(ActionContext context, ObjectResult result, Type objectType, object value) + { var formatterContext = new OutputFormatterWriteContext( context.HttpContext, WriterFactory, objectType, - result.Value); + value); var selectedFormatter = FormatterSelector.SelectFormatter( formatterContext, @@ -105,7 +148,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure if (selectedFormatter == null) { // No formatter supports this. - Logger.NoFormatter(formatterContext); + Logger.NoFormatter(formatterContext, result.ContentTypes); context.HttpContext.Response.StatusCode = StatusCodes.Status406NotAcceptable; return Task.CompletedTask; @@ -138,5 +181,21 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure result.ContentTypes.Add("application/problem+xml"); } } + + private static class Log + { + private static readonly Action _bufferingAsyncEnumerable; + + static Log() + { + _bufferingAsyncEnumerable = LoggerMessage.Define( + LogLevel.Debug, + new EventId(1, "BufferingAsyncEnumerable"), + "Buffering IAsyncEnumerable instance of type '{Type}'."); + } + + public static void BufferingAsyncEnumerable(ILogger logger, IAsyncEnumerable asyncEnumerable) + => _bufferingAsyncEnumerable(logger, asyncEnumerable.GetType().FullName, null); + } } } diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs index 49d1b3c653..16da9325d2 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/SystemTextJsonResultExecutor.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.IO; using System.Text; using System.Text.Json; @@ -25,13 +26,16 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure private readonly JsonOptions _options; private readonly ILogger _logger; + private readonly AsyncEnumerableReader _asyncEnumerableReader; public SystemTextJsonResultExecutor( IOptions options, - ILogger logger) + ILogger logger, + IOptions mvcOptions) { _options = options.Value; _logger = logger; + _asyncEnumerableReader = new AsyncEnumerableReader(mvcOptions.Value); } public async Task ExecuteAsync(ActionContext context, JsonResult result) @@ -70,8 +74,15 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure var writeStream = GetWriteStream(context.HttpContext, resolvedContentTypeEncoding); try { - var type = result.Value?.GetType() ?? typeof(object); - await JsonSerializer.WriteAsync(writeStream, result.Value, type, jsonSerializerOptions); + var value = result.Value; + if (value is IAsyncEnumerable asyncEnumerable) + { + Log.BufferingAsyncEnumerable(_logger, asyncEnumerable); + value = await _asyncEnumerableReader.ReadAsync(asyncEnumerable); + } + + var type = value?.GetType() ?? typeof(object); + await JsonSerializer.WriteAsync(writeStream, value, type, jsonSerializerOptions); await writeStream.FlushAsync(); } finally @@ -123,11 +134,19 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure new EventId(1, "JsonResultExecuting"), "Executing JsonResult, writing value of type '{Type}'."); + private static readonly Action _bufferingAsyncEnumerable = LoggerMessage.Define( + LogLevel.Debug, + new EventId(2, "BufferingAsyncEnumerable"), + "Buffering IAsyncEnumerable instance of type '{Type}'."); + public static void JsonResultExecuting(ILogger logger, object value) { var type = value == null ? "null" : value.GetType().FullName; _jsonResultExecuting(logger, type, null); } + + public static void BufferingAsyncEnumerable(ILogger logger, IAsyncEnumerable asyncEnumerable) + => _bufferingAsyncEnumerable(logger, asyncEnumerable.GetType().FullName, null); } } } diff --git a/src/Mvc/Mvc.Core/src/MvcCoreLoggerExtensions.cs b/src/Mvc/Mvc.Core/src/MvcCoreLoggerExtensions.cs index 26534c1712..17a94f3edf 100644 --- a/src/Mvc/Mvc.Core/src/MvcCoreLoggerExtensions.cs +++ b/src/Mvc/Mvc.Core/src/MvcCoreLoggerExtensions.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Reflection; using System.Security.Claims; @@ -28,8 +27,6 @@ namespace Microsoft.AspNetCore.Mvc public const string ActionFilter = "Action Filter"; private static readonly string[] _noFilters = new[] { "None" }; - private static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency; - private static readonly Action _actionExecuting; private static readonly Action _controllerActionExecuting; private static readonly Action _actionExecuted; @@ -73,7 +70,7 @@ namespace Microsoft.AspNetCore.Mvc private static readonly Action _localRedirectResultExecuting; private static readonly Action _objectResultExecuting; - private static readonly Action _noFormatter; + private static readonly Action, Exception> _noFormatter; private static readonly Action _formatterSelected; private static readonly Action _skippedContentNegotiation; private static readonly Action _noAcceptForNegotiation; @@ -300,10 +297,10 @@ namespace Microsoft.AspNetCore.Mvc new EventId(1, "LocalRedirectResultExecuting"), "Executing LocalRedirectResult, redirecting to {Destination}."); - _noFormatter = LoggerMessage.Define( + _noFormatter = LoggerMessage.Define>( LogLevel.Warning, new EventId(1, "NoFormatter"), - "No output formatter was found for content type '{ContentType}' to write the response."); + "No output formatter was found for content types '{ContentTypes}' to write the response."); _objectResultExecuting = LoggerMessage.Define( LogLevel.Information, @@ -1017,11 +1014,19 @@ namespace Microsoft.AspNetCore.Mvc public static void NoFormatter( this ILogger logger, - OutputFormatterCanWriteContext formatterContext) + OutputFormatterCanWriteContext context, + MediaTypeCollection contentTypes) { if (logger.IsEnabled(LogLevel.Warning)) { - _noFormatter(logger, Convert.ToString(formatterContext.ContentType), null); + var considered = new List(contentTypes); + + if (context.ContentType.HasValue) + { + considered.Add(Convert.ToString(context.ContentType)); + } + + _noFormatter(logger, considered, null); } } diff --git a/src/Mvc/Mvc.Core/src/MvcOptions.cs b/src/Mvc/Mvc.Core/src/MvcOptions.cs index 2cb5f9fa72..46cf9c63a3 100644 --- a/src/Mvc/Mvc.Core/src/MvcOptions.cs +++ b/src/Mvc/Mvc.Core/src/MvcOptions.cs @@ -359,6 +359,19 @@ namespace Microsoft.AspNetCore.Mvc } } + /// + /// Gets or sets the most number of entries of an that + /// that will buffer. + /// + /// When is an instance of , + /// will eagerly read the enumeration and add to a synchronous collection + /// prior to invoking the selected formatter. + /// This property determines the most number of entries that the executor is allowed to buffer. + /// + /// + /// Defaults to 8192. + public int MaxIAsyncEnumerableBufferLimit { get; set; } = 8192; + IEnumerator IEnumerable.GetEnumerator() => _switches.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => _switches.GetEnumerator(); diff --git a/src/Mvc/Mvc.Core/src/Properties/Resources.Designer.cs b/src/Mvc/Mvc.Core/src/Properties/Resources.Designer.cs index 2878cafd4c..c5a777379b 100644 --- a/src/Mvc/Mvc.Core/src/Properties/Resources.Designer.cs +++ b/src/Mvc/Mvc.Core/src/Properties/Resources.Designer.cs @@ -1746,6 +1746,20 @@ namespace Microsoft.AspNetCore.Mvc.Core internal static string FormatProperty_MustBeInstanceOfType(object p0, object p1, object p2) => string.Format(CultureInfo.CurrentCulture, GetString("Property_MustBeInstanceOfType"), p0, p1, p2); + /// + /// '{0}' reached the configured maximum size of the buffer when enumerating a value of type `{1}'. This limit is in place to prevent infinite streams of `IAsyncEnumerable` from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting '{1}' into a list rather than increasing the limit. + /// + internal static string ObjectResultExecutor_MaxEnumerationExceeded + { + get => GetString("ObjectResultExecutor_MaxEnumerationExceeded"); + } + + /// + /// '{0}' reached the configured maximum size of the buffer when enumerating a value of type `{1}'. This limit is in place to prevent infinite streams of `IAsyncEnumerable` from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting '{1}' into a list rather than increasing the limit. + /// + internal static string FormatObjectResultExecutor_MaxEnumerationExceeded(object p0, object p1) + => string.Format(CultureInfo.CurrentCulture, GetString("ObjectResultExecutor_MaxEnumerationExceeded"), p0, p1); + private static string GetString(string name, params string[] formatterNames) { var value = _resourceManager.GetString(name); diff --git a/src/Mvc/Mvc.Core/src/Resources.resx b/src/Mvc/Mvc.Core/src/Resources.resx index bbf596d558..43d3e79b84 100644 --- a/src/Mvc/Mvc.Core/src/Resources.resx +++ b/src/Mvc/Mvc.Core/src/Resources.resx @@ -503,5 +503,8 @@ Property '{0}.{1}' must be an instance of type '{2}'. - + + + '{0}' reached the configured maximum size of the buffer when enumerating a value of type '{1}'. This limit is in place to prevent infinite streams of 'IAsyncEnumerable<>' from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting '{1}' into a list rather than increasing the limit. + diff --git a/src/Mvc/Mvc.Core/test/AcceptedAtActionResultTests.cs b/src/Mvc/Mvc.Core/test/AcceptedAtActionResultTests.cs index 721b58ca9b..ba2cfed7ac 100644 --- a/src/Mvc/Mvc.Core/test/AcceptedAtActionResultTests.cs +++ b/src/Mvc/Mvc.Core/test/AcceptedAtActionResultTests.cs @@ -275,7 +275,8 @@ namespace Microsoft.AspNetCore.Mvc services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/AcceptedAtRouteResultTests.cs b/src/Mvc/Mvc.Core/test/AcceptedAtRouteResultTests.cs index 2200131971..63dab76bc0 100644 --- a/src/Mvc/Mvc.Core/test/AcceptedAtRouteResultTests.cs +++ b/src/Mvc/Mvc.Core/test/AcceptedAtRouteResultTests.cs @@ -183,7 +183,8 @@ namespace Microsoft.AspNetCore.Mvc services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/AcceptedResultTests.cs b/src/Mvc/Mvc.Core/test/AcceptedResultTests.cs index 07ca76072e..da714c3f50 100644 --- a/src/Mvc/Mvc.Core/test/AcceptedResultTests.cs +++ b/src/Mvc/Mvc.Core/test/AcceptedResultTests.cs @@ -139,7 +139,8 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/CreatedAtActionResultTests.cs b/src/Mvc/Mvc.Core/test/CreatedAtActionResultTests.cs index cad29a3043..be493c9eda 100644 --- a/src/Mvc/Mvc.Core/test/CreatedAtActionResultTests.cs +++ b/src/Mvc/Mvc.Core/test/CreatedAtActionResultTests.cs @@ -97,7 +97,8 @@ namespace Microsoft.AspNetCore.Mvc services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/CreatedAtRouteResultTests.cs b/src/Mvc/Mvc.Core/test/CreatedAtRouteResultTests.cs index 65410977a0..50eb7ba12b 100644 --- a/src/Mvc/Mvc.Core/test/CreatedAtRouteResultTests.cs +++ b/src/Mvc/Mvc.Core/test/CreatedAtRouteResultTests.cs @@ -110,7 +110,8 @@ namespace Microsoft.AspNetCore.Mvc services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/CreatedResultTests.cs b/src/Mvc/Mvc.Core/test/CreatedResultTests.cs index 6d3eefc85b..22e6b13637 100644 --- a/src/Mvc/Mvc.Core/test/CreatedResultTests.cs +++ b/src/Mvc/Mvc.Core/test/CreatedResultTests.cs @@ -98,7 +98,8 @@ namespace Microsoft.AspNetCore.Mvc services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/HttpNotFoundObjectResultTest.cs b/src/Mvc/Mvc.Core/test/HttpNotFoundObjectResultTest.cs index 498a12c57a..42ef48b2f0 100644 --- a/src/Mvc/Mvc.Core/test/HttpNotFoundObjectResultTest.cs +++ b/src/Mvc/Mvc.Core/test/HttpNotFoundObjectResultTest.cs @@ -75,7 +75,8 @@ namespace Microsoft.AspNetCore.Mvc services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/HttpOkObjectResultTest.cs b/src/Mvc/Mvc.Core/test/HttpOkObjectResultTest.cs index 13f5572c4e..49fac14fff 100644 --- a/src/Mvc/Mvc.Core/test/HttpOkObjectResultTest.cs +++ b/src/Mvc/Mvc.Core/test/HttpOkObjectResultTest.cs @@ -76,7 +76,8 @@ namespace Microsoft.AspNetCore.Mvc services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); return services.BuildServiceProvider(); } diff --git a/src/Mvc/Mvc.Core/test/Infrastructure/AsyncEnumerableReaderTest.cs b/src/Mvc/Mvc.Core/test/Infrastructure/AsyncEnumerableReaderTest.cs new file mode 100644 index 0000000000..27baf232c9 --- /dev/null +++ b/src/Mvc/Mvc.Core/test/Infrastructure/AsyncEnumerableReaderTest.cs @@ -0,0 +1,84 @@ +// 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.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Options; +using Xunit; + +namespace Microsoft.AspNetCore.Mvc.Infrastructure +{ + public class AsyncEnumerableReaderTest + { + [Fact] + public async Task ReadAsync_ReadsIAsyncEnumerable() + { + // Arrange + var options = new MvcOptions(); + var reader = new AsyncEnumerableReader(options); + + // Act + var result = await reader.ReadAsync(TestEnumerable()); + + // Assert + var collection = Assert.IsAssignableFrom>(result); + Assert.Equal(new[] { "0", "1", "2", }, collection); + } + + [Fact] + public async Task ReadAsync_ReadsIAsyncEnumerable_ImplementingMultipleAsyncEnumerableInterfaces() + { + // This test ensures the reader does not fail if you have a type that implements IAsyncEnumerable for multiple Ts + // Arrange + var options = new MvcOptions(); + var reader = new AsyncEnumerableReader(options); + + // Act + var result = await reader.ReadAsync(new MultiAsyncEnumerable()); + + // Assert + var collection = Assert.IsAssignableFrom>(result); + Assert.Equal(new[] { "0", "1", "2", }, collection); + } + + [Fact] + public async Task ReadAsync_ThrowsIfBufferimitIsReached() + { + // Arrange + var enumerable = TestEnumerable(11); + var expected = $"'AsyncEnumerableReader' reached the configured maximum size of the buffer when enumerating a value of type '{enumerable.GetType()}'. " + + "This limit is in place to prevent infinite streams of 'IAsyncEnumerable<>' from continuing indefinitely. If this is not a programming mistake, " + + $"consider ways to reduce the collection size, or consider manually converting '{enumerable.GetType()}' into a list rather than increasing the limit."; + var options = new MvcOptions { MaxIAsyncEnumerableBufferLimit = 10 }; + var reader = new AsyncEnumerableReader(options); + + // Act + var ex = await Assert.ThrowsAsync(() => reader.ReadAsync(enumerable)); + + // Assert + Assert.Equal(expected, ex.Message); + } + + public static async IAsyncEnumerable TestEnumerable(int count = 3) + { + await Task.Yield(); + for (var i = 0; i < count; i++) + { + yield return i.ToString(); + } + } + + public class MultiAsyncEnumerable : IAsyncEnumerable, IAsyncEnumerable + { + public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return TestEnumerable().GetAsyncEnumerator(cancellationToken); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + => GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/src/Mvc/Mvc.Core/test/Infrastructure/ControllerActionInvokerTest.cs b/src/Mvc/Mvc.Core/test/Infrastructure/ControllerActionInvokerTest.cs index 70ce4124e1..dda560bba4 100644 --- a/src/Mvc/Mvc.Core/test/Infrastructure/ControllerActionInvokerTest.cs +++ b/src/Mvc/Mvc.Core/test/Infrastructure/ControllerActionInvokerTest.cs @@ -1567,7 +1567,8 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure services.AddSingleton>(new ObjectResultExecutor( new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); httpContext.Response.Body = new MemoryStream(); httpContext.RequestServices = services.BuildServiceProvider(); diff --git a/src/Mvc/Mvc.Core/test/Infrastructure/JsonResultExecutorTestBase.cs b/src/Mvc/Mvc.Core/test/Infrastructure/JsonResultExecutorTestBase.cs index 5c025909b0..884f4f213e 100644 --- a/src/Mvc/Mvc.Core/test/Infrastructure/JsonResultExecutorTestBase.cs +++ b/src/Mvc/Mvc.Core/test/Infrastructure/JsonResultExecutorTestBase.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -310,6 +311,24 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure Assert.StartsWith("Property 'JsonResult.SerializerSettings' must be an instance of type", ex.Message); } + [Fact] + public async Task ExecuteAsync_SerializesAsyncEnumerables() + { + // Arrange + var expected = Encoding.UTF8.GetBytes(JsonSerializer.ToString(new[] { "Hello", "world" })); + + var context = GetActionContext(); + var result = new JsonResult(TestAsyncEnumerable()); + var executor = CreateExecutor(); + + // Act + await executor.ExecuteAsync(context, result); + + // Assert + var written = GetWrittenBytes(context.HttpContext); + Assert.Equal(expected, written); + } + protected IActionResultExecutor CreateExecutor() => CreateExecutor(NullLoggerFactory.Instance); protected abstract IActionResultExecutor CreateExecutor(ILoggerFactory loggerFactory); @@ -354,5 +373,12 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure { public string Property { get; set; } } + + private async IAsyncEnumerable TestAsyncEnumerable() + { + await Task.Yield(); + yield return "Hello"; + yield return "world"; + } } } diff --git a/src/Mvc/Mvc.Core/test/Infrastructure/ObjectResultExecutorTest.cs b/src/Mvc/Mvc.Core/test/Infrastructure/ObjectResultExecutorTest.cs index 207d04161f..8ab2d76678 100644 --- a/src/Mvc/Mvc.Core/test/Infrastructure/ObjectResultExecutorTest.cs +++ b/src/Mvc/Mvc.Core/test/Infrastructure/ObjectResultExecutorTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; @@ -209,8 +210,8 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure public async Task ExecuteAsync_FallsBackOnFormattersInOptions() { // Arrange - var options = Options.Create(new MvcOptions()); - options.Value.OutputFormatters.Add(new TestJsonOutputFormatter()); + var options = new MvcOptions(); + options.OutputFormatters.Add(new TestJsonOutputFormatter()); var executor = CreateExecutor(options: options); @@ -300,8 +301,8 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure string expectedContentType) { // Arrange - var options = Options.Create(new MvcOptions()); - options.Value.RespectBrowserAcceptHeader = false; + var options = new MvcOptions(); + options.RespectBrowserAcceptHeader = false; var executor = CreateExecutor(options: options); @@ -337,8 +338,8 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure string expectedContentType) { // Arrange - var options = Options.Create(new MvcOptions()); - options.Value.RespectBrowserAcceptHeader = true; + var options = new MvcOptions(); + options.RespectBrowserAcceptHeader = true; var executor = CreateExecutor(options: options); @@ -360,6 +361,106 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure MediaTypeAssert.Equal(expectedContentType, responseContentType); } + [Fact] + public async Task ObjectResult_ReadsAsyncEnumerables() + { + // Arrange + var executor = CreateExecutor(); + var result = new ObjectResult(AsyncEnumerable()); + var formatter = new TestJsonOutputFormatter(); + result.Formatters.Add(formatter); + + var actionContext = new ActionContext() + { + HttpContext = GetHttpContext(), + }; + + // Act + await executor.ExecuteAsync(actionContext, result); + + // Assert + var formatterContext = formatter.LastOutputFormatterContext; + Assert.Equal(typeof(List), formatterContext.ObjectType); + var value = Assert.IsType>(formatterContext.Object); + Assert.Equal(new[] { "Hello 0", "Hello 1", "Hello 2", "Hello 3", }, value); + } + + [Fact] + public async Task ObjectResult_Throws_IfEnumerableThrows() + { + // Arrange + var executor = CreateExecutor(); + var result = new ObjectResult(AsyncEnumerable(throwError: true)); + var formatter = new TestJsonOutputFormatter(); + result.Formatters.Add(formatter); + + var actionContext = new ActionContext() + { + HttpContext = GetHttpContext(), + }; + + // Act & Assert + await Assert.ThrowsAsync(() => executor.ExecuteAsync(actionContext, result)); + } + + [Fact] + public async Task ObjectResult_AsyncEnumeration_AtLimit() + { + // Arrange + var count = 24; + var executor = CreateExecutor(options: new MvcOptions { MaxIAsyncEnumerableBufferLimit = count }); + var result = new ObjectResult(AsyncEnumerable(count: count)); + var formatter = new TestJsonOutputFormatter(); + result.Formatters.Add(formatter); + + var actionContext = new ActionContext() + { + HttpContext = GetHttpContext(), + }; + + // Act + await executor.ExecuteAsync(actionContext, result); + + // Assert + var formatterContext = formatter.LastOutputFormatterContext; + var value = Assert.IsType>(formatterContext.Object); + Assert.Equal(24, value.Count); + } + + [Theory] + [InlineData(25)] + [InlineData(1024)] + public async Task ObjectResult_Throws_IfEnumerationExceedsLimit(int count) + { + // Arrange + var executor = CreateExecutor(options: new MvcOptions { MaxIAsyncEnumerableBufferLimit = 24 }); + var result = new ObjectResult(AsyncEnumerable(count: count)); + var formatter = new TestJsonOutputFormatter(); + result.Formatters.Add(formatter); + + var actionContext = new ActionContext() + { + HttpContext = GetHttpContext(), + }; + + // Act & Assert + var ex = await Assert.ThrowsAsync(() => executor.ExecuteAsync(actionContext, result)); + } + + private static async IAsyncEnumerable AsyncEnumerable(int count = 4, bool throwError = false) + { + await Task.Yield(); + for (var i = 0; i < count; i++) + { + yield return $"Hello {i}"; + } + + if (throwError) + { + throw new TimeZoneNotFoundException(); + } + } + private static IServiceCollection CreateServices() { var services = new ServiceCollection(); @@ -379,10 +480,12 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return httpContext; } - private static ObjectResultExecutor CreateExecutor(IOptions options = null) + private static ObjectResultExecutor CreateExecutor(MvcOptions options = null) { - var selector = new DefaultOutputFormatterSelector(options ?? Options.Create(new MvcOptions()), NullLoggerFactory.Instance); - return new ObjectResultExecutor(selector, new TestHttpResponseStreamWriterFactory(), NullLoggerFactory.Instance); + options ??= new MvcOptions(); + var optionsAccessor = Options.Create(options); + var selector = new DefaultOutputFormatterSelector(optionsAccessor, NullLoggerFactory.Instance); + return new ObjectResultExecutor(selector, new TestHttpResponseStreamWriterFactory(), NullLoggerFactory.Instance, optionsAccessor); } private class CannotWriteFormatter : IOutputFormatter @@ -409,8 +512,11 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure SupportedEncodings.Add(Encoding.UTF8); } + public OutputFormatterWriteContext LastOutputFormatterContext { get; private set; } + public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) { + LastOutputFormatterContext = context; return Task.FromResult(0); } } diff --git a/src/Mvc/Mvc.Core/test/Infrastructure/SystemTextJsonResultExecutorTest.cs b/src/Mvc/Mvc.Core/test/Infrastructure/SystemTextJsonResultExecutorTest.cs index 80c20f7a15..5fd36427de 100644 --- a/src/Mvc/Mvc.Core/test/Infrastructure/SystemTextJsonResultExecutorTest.cs +++ b/src/Mvc/Mvc.Core/test/Infrastructure/SystemTextJsonResultExecutorTest.cs @@ -11,7 +11,10 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure { protected override IActionResultExecutor CreateExecutor(ILoggerFactory loggerFactory) { - return new SystemTextJsonResultExecutor(Options.Create(new JsonOptions()), loggerFactory.CreateLogger()); + return new SystemTextJsonResultExecutor( + Options.Create(new JsonOptions()), + loggerFactory.CreateLogger(), + Options.Create(new MvcOptions())); } protected override object GetIndentedSettings() diff --git a/src/Mvc/Mvc.Core/test/ModelBinding/Binders/ComplexTypeModelBinderTest.cs b/src/Mvc/Mvc.Core/test/ModelBinding/Binders/ComplexTypeModelBinderTest.cs index d8f282c337..14db921930 100644 --- a/src/Mvc/Mvc.Core/test/ModelBinding/Binders/ComplexTypeModelBinderTest.cs +++ b/src/Mvc/Mvc.Core/test/ModelBinding/Binders/ComplexTypeModelBinderTest.cs @@ -1195,8 +1195,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders binder.SetPropertyPublic(bindingContext, "foo", propertyMetadata, result); // Assert - Assert.Equal("Date of death can't be before date of birth." + Environment.NewLine - + "Parameter name: value", + Assert.Equal("Date of death can't be before date of birth. (Parameter 'value')", bindingContext.ModelState["foo"].Errors[0].Exception.Message); } @@ -1219,8 +1218,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders // Assert Assert.False(bindingContext.ModelState.IsValid); Assert.Single(bindingContext.ModelState["foo.NameNoAttribute"].Errors); - Assert.Equal("This is a different exception." + Environment.NewLine - + "Parameter name: value", + Assert.Equal("This is a different exception. (Parameter 'value')", bindingContext.ModelState["foo.NameNoAttribute"].Errors[0].Exception.Message); } diff --git a/src/Mvc/Mvc.Core/test/MvcCoreLoggerExtensionsTest.cs b/src/Mvc/Mvc.Core/test/MvcCoreLoggerExtensionsTest.cs index ae6987a4c4..37688c2107 100644 --- a/src/Mvc/Mvc.Core/test/MvcCoreLoggerExtensionsTest.cs +++ b/src/Mvc/Mvc.Core/test/MvcCoreLoggerExtensionsTest.cs @@ -1,7 +1,9 @@ // 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.Http; using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Extensions.Logging.Testing; using Moq; using Xunit; @@ -282,6 +284,37 @@ namespace Microsoft.AspNetCore.Mvc write.State.ToString()); } + [Fact] + public void NoFormatter_LogsListOfContentTypes() + { + // Arrange + var testSink = new TestSink(); + var loggerFactory = new TestLoggerFactory(testSink, enabled: true); + var logger = loggerFactory.CreateLogger("test"); + + var mediaTypes = new MediaTypeCollection + { + "application/problem+json", + "application/problem+xml", + }; + + var httpContext = Mock.Of(); + var context = new Mock(httpContext); + + context.SetupGet(x => x.ContentType).Returns("application/json"); + + // Act + logger.NoFormatter(context.Object, mediaTypes); + + // Assert + var write = Assert.Single(testSink.Writes); + Assert.Equal( + "No output formatter was found for content types " + + "'application/problem+json, application/problem+xml, application/json'" + + " to write the response.", + write.State.ToString()); + } + public interface IOrderedAuthorizeFilter : IAuthorizationFilter, IAsyncAuthorizationFilter, IOrderedFilter { } public interface IOrderedResourceFilter : IResourceFilter, IAsyncResourceFilter, IOrderedFilter { } diff --git a/src/Mvc/Mvc.Core/test/ObjectResultTests.cs b/src/Mvc/Mvc.Core/test/ObjectResultTests.cs index 7b818ad97b..5f210f2921 100644 --- a/src/Mvc/Mvc.Core/test/ObjectResultTests.cs +++ b/src/Mvc/Mvc.Core/test/ObjectResultTests.cs @@ -97,10 +97,12 @@ namespace Microsoft.AspNetCore.Mvc private static IServiceProvider CreateServices() { var services = new ServiceCollection(); + var options = Options.Create(new MvcOptions()); services.AddSingleton>(new ObjectResultExecutor( - new DefaultOutputFormatterSelector(Options.Create(new MvcOptions()), NullLoggerFactory.Instance), + new DefaultOutputFormatterSelector(options, NullLoggerFactory.Instance), new TestHttpResponseStreamWriterFactory(), - NullLoggerFactory.Instance)); + NullLoggerFactory.Instance, + options)); services.AddSingleton(NullLoggerFactory.Instance); return services.BuildServiceProvider(); diff --git a/src/Mvc/Mvc.Core/test/Routing/AttributeRoutingTest.cs b/src/Mvc/Mvc.Core/test/Routing/AttributeRoutingTest.cs index eb170882ed..f5097d39f7 100644 --- a/src/Mvc/Mvc.Core/test/Routing/AttributeRoutingTest.cs +++ b/src/Mvc/Mvc.Core/test/Routing/AttributeRoutingTest.cs @@ -37,8 +37,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing "Error: The route parameter name 'a/dkfk' is invalid. Route parameter names must be non-empty and " + "cannot contain these characters: '{', '}', '/'. The '?' character marks a parameter as optional, " + "and can occur only at the end of the parameter. The '*' character marks a parameter as catch-all, " + - "and can occur only at the start of the parameter." + Environment.NewLine + - "Parameter name: routeTemplate"; + "and can occur only at the start of the parameter. (Parameter 'routeTemplate')"; var services = CreateServices(action); diff --git a/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj b/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj index 285e6f5142..2c81323847 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj +++ b/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj @@ -6,6 +6,7 @@ true aspnetcore;aspnetcoremvc;json true + $(DefineConstants);JSONNET @@ -21,5 +22,6 @@ + diff --git a/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonLoggerExtensions.cs b/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonLoggerExtensions.cs index dfad01025e..a8be4c7917 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonLoggerExtensions.cs +++ b/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonLoggerExtensions.cs @@ -10,7 +10,6 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson { private static readonly Action _jsonInputFormatterException; - private static readonly Action _jsonResultExecuting; static NewtonsoftJsonLoggerExtensions() { @@ -18,22 +17,11 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson LogLevel.Debug, new EventId(1, "JsonInputException"), "JSON input formatter threw an exception."); - - _jsonResultExecuting = LoggerMessage.Define( - LogLevel.Information, - new EventId(1, "JsonResultExecuting"), - "Executing JsonResult, writing value of type '{Type}'."); } public static void JsonInputException(this ILogger logger, Exception exception) { _jsonInputFormatterException(logger, exception); } - - public static void JsonResultExecuting(this ILogger logger, object value) - { - var type = value == null ? "null" : value.GetType().FullName; - _jsonResultExecuting(logger, type, null); - } } } diff --git a/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonResultExecutor.cs b/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonResultExecutor.cs index 1dc0b26fab..eac7d6400a 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonResultExecutor.cs +++ b/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonResultExecutor.cs @@ -3,10 +3,9 @@ using System; using System.Buffers; -using System.IO; +using System.Collections.Generic; using System.Text; using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.WebUtilities; @@ -32,6 +31,7 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson private readonly MvcOptions _mvcOptions; private readonly MvcNewtonsoftJsonOptions _jsonOptions; private readonly IArrayPool _charPool; + private readonly AsyncEnumerableReader _asyncEnumerableReader; /// /// Creates a new . @@ -73,6 +73,7 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson _mvcOptions = mvcOptions?.Value ?? throw new ArgumentNullException(nameof(mvcOptions)); _jsonOptions = jsonOptions.Value; _charPool = new JsonArrayPool(charPool); + _asyncEnumerableReader = new AsyncEnumerableReader(_mvcOptions); } /// @@ -111,7 +112,7 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson response.StatusCode = result.StatusCode.Value; } - _logger.JsonResultExecuting(result.Value); + Log.JsonResultExecuting(_logger, result.Value); var responseStream = response.Body; FileBufferingWriteStream fileBufferingWriteStream = null; @@ -131,7 +132,14 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson jsonWriter.AutoCompleteOnClose = false; var jsonSerializer = JsonSerializer.Create(jsonSerializerSettings); - jsonSerializer.Serialize(jsonWriter, result.Value); + var value = result.Value; + if (result.Value is IAsyncEnumerable asyncEnumerable) + { + Log.BufferingAsyncEnumerable(_logger, asyncEnumerable); + value = await _asyncEnumerableReader.ReadAsync(asyncEnumerable); + } + + jsonSerializer.Serialize(jsonWriter, value); } if (fileBufferingWriteStream != null) @@ -168,5 +176,33 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson return settingsFromResult; } } + + private static class Log + { + private static readonly Action _jsonResultExecuting; + private static readonly Action _bufferingAsyncEnumerable; + + static Log() + { + _jsonResultExecuting = LoggerMessage.Define( + LogLevel.Information, + new EventId(1, "JsonResultExecuting"), + "Executing JsonResult, writing value of type '{Type}'."); + + _bufferingAsyncEnumerable = LoggerMessage.Define( + LogLevel.Debug, + new EventId(1, "BufferingAsyncEnumerable"), + "Buffering IAsyncEnumerable instance of type '{Type}'."); + } + + public static void JsonResultExecuting(ILogger logger, object value) + { + var type = value == null ? "null" : value.GetType().FullName; + _jsonResultExecuting(logger, type, null); + } + + public static void BufferingAsyncEnumerable(ILogger logger, IAsyncEnumerable asyncEnumerable) + => _bufferingAsyncEnumerable(logger, asyncEnumerable.GetType().FullName, null); + } } } diff --git a/src/Mvc/Mvc.NewtonsoftJson/src/Properties/Resources.Designer.cs b/src/Mvc/Mvc.NewtonsoftJson/src/Properties/Resources.Designer.cs index b089148e77..82aedac1ec 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/src/Properties/Resources.Designer.cs +++ b/src/Mvc/Mvc.NewtonsoftJson/src/Properties/Resources.Designer.cs @@ -108,6 +108,20 @@ namespace Microsoft.AspNetCore.Mvc.NewtonsoftJson internal static string FormatTempData_CannotSerializeType(object p0, object p1) => string.Format(CultureInfo.CurrentCulture, GetString("TempData_CannotSerializeType"), p0, p1); + /// + /// '{0}' reached the configured maximum size of the buffer when enumerating a value of type `{1}'. This limit is in place to prevent infinite streams of `IAsyncEnumerable` from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting '{1}' into a list rather than increasing the limit. + /// + internal static string ObjectResultExecutor_MaxEnumerationExceeded + { + get => GetString("ObjectResultExecutor_MaxEnumerationExceeded"); + } + + /// + /// '{0}' reached the configured maximum size of the buffer when enumerating a value of type `{1}'. This limit is in place to prevent infinite streams of `IAsyncEnumerable` from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting '{1}' into a list rather than increasing the limit. + /// + internal static string FormatObjectResultExecutor_MaxEnumerationExceeded(object p0, object p1) + => string.Format(CultureInfo.CurrentCulture, GetString("ObjectResultExecutor_MaxEnumerationExceeded"), p0, p1); + private static string GetString(string name, params string[] formatterNames) { var value = _resourceManager.GetString(name); diff --git a/src/Mvc/Mvc.NewtonsoftJson/src/Resources.resx b/src/Mvc/Mvc.NewtonsoftJson/src/Resources.resx index cedf5cbcde..4887c8adbc 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/src/Resources.resx +++ b/src/Mvc/Mvc.NewtonsoftJson/src/Resources.resx @@ -1,17 +1,17 @@  - @@ -126,6 +126,9 @@ Parameter '{0}' must be an instance of {1} provided by the '{2}' package. Configure the correct instance using '{3}' in your startup. + + '{0}' reached the configured maximum size of the buffer when enumerating a value of type '{1}'. This limit is in place to prevent infinite streams of 'IAsyncEnumerable<>' from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting '{1}' into a list rather than increasing the limit. + Property '{0}.{1}' must be an instance of type '{2}'. @@ -138,4 +141,4 @@ The '{0}' cannot serialize an object of type '{1}'. - \ No newline at end of file + diff --git a/src/Mvc/Mvc.NewtonsoftJson/test/Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj b/src/Mvc/Mvc.NewtonsoftJson/test/Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj index 734fc8d429..0cf127eac9 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/test/Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj +++ b/src/Mvc/Mvc.NewtonsoftJson/test/Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Mvc/Mvc.Razor/src/Internal/RazorInjectAttribute.cs b/src/Mvc/Mvc.Razor/src/Internal/RazorInjectAttribute.cs index 72b1c31f49..a981e6eb66 100644 --- a/src/Mvc/Mvc.Razor/src/Internal/RazorInjectAttribute.cs +++ b/src/Mvc/Mvc.Razor/src/Internal/RazorInjectAttribute.cs @@ -5,8 +5,15 @@ using System; namespace Microsoft.AspNetCore.Mvc.Razor.Internal { + /// + /// Specifies that the attributed property should be bound using request services. + /// + /// This attribute is used as the backing attribute for the @inject + /// Razor directive. + /// + /// [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class RazorInjectAttribute : Attribute { } -} \ No newline at end of file +} diff --git a/src/Mvc/test/Mvc.FunctionalTests/AsyncEnumerableTestBase.cs b/src/Mvc/test/Mvc.FunctionalTests/AsyncEnumerableTestBase.cs new file mode 100644 index 0000000000..75160338f0 --- /dev/null +++ b/src/Mvc/test/Mvc.FunctionalTests/AsyncEnumerableTestBase.cs @@ -0,0 +1,97 @@ +// 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.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +using System.Xml.Linq; +using FormatterWebSite; +using Xunit; + +namespace Microsoft.AspNetCore.Mvc.FunctionalTests +{ + public class AsyncEnumerableTestBase : IClassFixture> + { + public AsyncEnumerableTestBase(MvcTestFixture fixture) + { + Client = fixture.CreateDefaultClient(); + } + + public HttpClient Client { get; } + + [Fact] + public Task AsyncEnumerableReturnedWorks() => AsyncEnumerableWorks(); + + [Fact] + public Task AsyncEnumerableWrappedInTask() => AsyncEnumerableWorks(); + + private async Task AsyncEnumerableWorks() + { + // Act + var response = await Client.GetAsync("asyncenumerable/getallprojects"); + + // Assert + await response.AssertStatusCodeAsync(HttpStatusCode.OK); + + var content = await response.Content.ReadAsStringAsync(); + + // Some sanity tests to verify things serialized correctly. + var projects = JsonSerializer.Parse>(content, TestJsonSerializerOptionsProvider.Options); + Assert.Equal(10, projects.Count); + Assert.Equal("Project0", projects[0].Name); + Assert.Equal("Project9", projects[9].Name); + } + + [Fact] + public async Task AsyncEnumerableExceptionsAreThrown() + { + // Act + var response = await Client.GetAsync("asyncenumerable/GetAllProjectsWithError"); + + // Assert + await response.AssertStatusCodeAsync(HttpStatusCode.InternalServerError); + + var content = await response.Content.ReadAsStringAsync(); + + // Verify that the exception shows up in the callstack + Assert.Contains(nameof(InvalidTimeZoneException), content); + } + + [Fact] + public async Task AsyncEnumerableWithXmlFormatterWorks() + { + // Arrange + var request = new HttpRequestMessage(HttpMethod.Get, "asyncenumerable/getallprojects"); + request.Headers.Add("Accept", "application/xml"); + + // Act + var response = await Client.SendAsync(request); + + // Assert + await response.AssertStatusCodeAsync(HttpStatusCode.OK); + + var content = await response.Content.ReadAsStringAsync(); + + // Some sanity tests to verify things serialized correctly. + var xml = XDocument.Parse(content); + var @namespace = xml.Root.Name.NamespaceName; + var projects = xml.Root.Elements(XName.Get("Project", @namespace)); + Assert.Equal(10, projects.Count()); + + Assert.Equal("Project0", GetName(projects.ElementAt(0))); + Assert.Equal("Project9", GetName(projects.ElementAt(9))); + + string GetName(XElement element) + { + var name = element.Element(XName.Get("Name", @namespace)); + Assert.NotNull(name); + + return name.Value; + } + } + } +} diff --git a/src/Mvc/test/Mvc.FunctionalTests/InputObjectValidationTests.cs b/src/Mvc/test/Mvc.FunctionalTests/InputObjectValidationTests.cs index 78c3ce254c..97290f7278 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/InputObjectValidationTests.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/InputObjectValidationTests.cs @@ -261,9 +261,13 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests Content = new StringContent(@"{ ""Id"": ""S-1-5-21-1004336348-1177238915-682003330-512"" }", Encoding.UTF8, "application/json"), }; - // Act & Assert - var ex = await Assert.ThrowsAsync(() => Client.SendAsync(requestMessage)); - Assert.Equal(expected, ex.Message); + // Act + var response = await Client.SendAsync(requestMessage); + + // Assert + await response.AssertStatusCodeAsync(HttpStatusCode.InternalServerError); + var content = await response.Content.ReadAsStringAsync(); + Assert.Contains(expected, content); } [Fact] @@ -356,4 +360,4 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests }); } } -} \ No newline at end of file +} diff --git a/src/Mvc/test/Mvc.FunctionalTests/TestJsonSerializationOptionsProvider.cs b/src/Mvc/test/Mvc.FunctionalTests/TestJsonSerializationOptionsProvider.cs new file mode 100644 index 0000000000..4a418cb0f6 --- /dev/null +++ b/src/Mvc/test/Mvc.FunctionalTests/TestJsonSerializationOptionsProvider.cs @@ -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 System.Text.Json; + +namespace Microsoft.AspNetCore.Mvc.FunctionalTests +{ + internal static class TestJsonSerializerOptionsProvider + { + public static JsonSerializerOptions Options = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + }; + } +} diff --git a/src/Mvc/test/WebSites/FormatterWebSite/Controllers/AsyncEnumerableController.cs b/src/Mvc/test/WebSites/FormatterWebSite/Controllers/AsyncEnumerableController.cs new file mode 100644 index 0000000000..864e385c76 --- /dev/null +++ b/src/Mvc/test/WebSites/FormatterWebSite/Controllers/AsyncEnumerableController.cs @@ -0,0 +1,48 @@ +// 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.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace FormatterWebSite.Controllers +{ + [ApiController] + [Route("{controller}/{action}")] + public class AsyncEnumerableController : ControllerBase + { + [HttpGet] + public IAsyncEnumerable GetAllProjects() + => GetAllProjectsCore(); + + [HttpGet] + public async Task> GetAllProjectsAsTask() + { + await Task.Yield(); + return GetAllProjectsCore(); + } + + [HttpGet] + public IAsyncEnumerable GetAllProjectsWithError() + => GetAllProjectsCore(true); + + public async IAsyncEnumerable GetAllProjectsCore(bool throwError = false) + { + await Task.Delay(5); + for (var i = 0; i < 10; i++) + { + if (throwError && i == 5) + { + throw new InvalidTimeZoneException(); + } + + yield return new Project + { + Id = i, + Name = $"Project{i}", + }; + } + } + } +} diff --git a/src/Mvc/test/WebSites/FormatterWebSite/Startup.cs b/src/Mvc/test/WebSites/FormatterWebSite/Startup.cs index ba036d9a08..ac3d04966f 100644 --- a/src/Mvc/test/WebSites/FormatterWebSite/Startup.cs +++ b/src/Mvc/test/WebSites/FormatterWebSite/Startup.cs @@ -26,6 +26,8 @@ namespace FormatterWebSite public void Configure(IApplicationBuilder app) { + app.UseDeveloperExceptionPage(); + app.UseRouting(); app.UseEndpoints(endpoints => { diff --git a/src/ProjectTemplates/Web.ItemTemplates/content/RazorComponent/Component1.razor b/src/ProjectTemplates/Web.ItemTemplates/content/RazorComponent/Component1.razor index bc0a14eec4..ec18562296 100644 --- a/src/ProjectTemplates/Web.ItemTemplates/content/RazorComponent/Component1.razor +++ b/src/ProjectTemplates/Web.ItemTemplates/content/RazorComponent/Component1.razor @@ -1,4 +1,4 @@ -

Component1

+

Component1

@code { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/WebApi-FSharp.fsproj.in b/src/ProjectTemplates/Web.ProjectTemplates/WebApi-FSharp.fsproj.in index c6017dc6c8..714aa82b2e 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/WebApi-FSharp.fsproj.in +++ b/src/ProjectTemplates/Web.ProjectTemplates/WebApi-FSharp.fsproj.in @@ -7,7 +7,8 @@ - + + diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs index b10d62ad78..da0169c658 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs @@ -9,11 +9,12 @@ namespace GrpcService_CSharp { public class GreeterService : Greeter.GreeterBase { - private readonly ILogger logger; - public GreeterService(ILogger _logger) + private readonly ILogger _logger; + public GreeterService(ILogger logger) { - logger = _logger; + _logger = logger; } + public override Task SayHello(HelloRequest request, ServerCallContext context) { return Task.FromResult(new HelloReply diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Account/LogOut.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Account/LogOut.cshtml index 4ea81fc052..c6da14beca 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Account/LogOut.cshtml +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Account/LogOut.cshtml @@ -1,4 +1,4 @@ -@page +@page @using Microsoft.AspNetCore.Identity @inject SignInManager SignInManager @functions { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Shared/_LoginPartial.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Shared/_LoginPartial.cshtml index e55bafe6a7..e35168507a 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Shared/_LoginPartial.cshtml +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Areas/Identity/Pages/Shared/_LoginPartial.cshtml @@ -1,4 +1,4 @@ -@using Microsoft.AspNetCore.Identity +@using Microsoft.AspNetCore.Identity @inject SignInManager SignInManager @inject UserManager UserManager @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Data/WeatherForecastService.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Data/WeatherForecastService.cs index 1e27490eda..9d2bfa5f1d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Data/WeatherForecastService.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Data/WeatherForecastService.cs @@ -6,7 +6,7 @@ namespace RazorComponentsWeb_CSharp.Data { public class WeatherForecastService { - private static string[] Summaries = new[] + private static readonly string[] Summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/Counter.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/Counter.razor index ea87f6be2d..1360f9eb12 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/Counter.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/Counter.razor @@ -1,4 +1,4 @@ -@page "/counter" +@page "/counter"

Counter

diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/FetchData.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/FetchData.razor index 25e30159f4..896e045212 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/FetchData.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/FetchData.razor @@ -1,4 +1,4 @@ -@page "/fetchdata" +@page "/fetchdata" @using RazorComponentsWeb_CSharp.Data @inject WeatherForecastService ForecastService diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/_Host.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/_Host.cshtml index 4eff49f3b4..9bf4baa567 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/_Host.cshtml +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Pages/_Host.cshtml @@ -1,4 +1,4 @@ -@page "/" +@page "/" @namespace RazorComponentsWeb_CSharp.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualB2CAuth.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualB2CAuth.razor index d971d6206e..c8891a3360 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualB2CAuth.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualB2CAuth.razor @@ -1,4 +1,4 @@ -@using Microsoft.AspNetCore.Authentication.AzureADB2C.UI +@using Microsoft.AspNetCore.Authentication.AzureADB2C.UI @using Microsoft.Extensions.Options @inject IOptionsMonitor AzureADB2COptions diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualLocalAuth.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualLocalAuth.razor index efe5d380ee..9c976507b7 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualLocalAuth.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.IndividualLocalAuth.razor @@ -1,4 +1,4 @@ - + Hello, @context.User.Identity.Name! Log out diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.OrganizationalAuth.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.OrganizationalAuth.razor index fd7d5a95e7..fc4422a056 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.OrganizationalAuth.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.OrganizationalAuth.razor @@ -1,4 +1,4 @@ - + Hello, @context.User.Identity.Name! Log out diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.WindowsAuth.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.WindowsAuth.razor index 77d7fb78f2..bf579153e2 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.WindowsAuth.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/LoginDisplay.WindowsAuth.razor @@ -1,3 +1,3 @@ - + Hello, @context.User.Identity.Name! diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/NavMenu.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/NavMenu.razor index e64d6b2c21..e2bcf2c748 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/NavMenu.razor +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/Shared/NavMenu.razor @@ -1,4 +1,4 @@ -