Merge branch 'release/3.0' into merge/release/3.0-preview8-to-release/3.0
This commit is contained in:
commit
0dc822a6ad
|
|
@ -69,6 +69,11 @@ parameters:
|
|||
installJdk: true
|
||||
timeoutInMinutes: 180
|
||||
|
||||
# We need longer than the default amount of 5 minutes to upload our logs/artifacts. (We currently take around 5 mins in the best case).
|
||||
# This makes sure we have time to upload everything in the case of a build timeout - really important for investigating a build
|
||||
# timeout due to test hangs.
|
||||
cancelTimeoutInMinutes: 15
|
||||
|
||||
jobs:
|
||||
- job: ${{ coalesce(parameters.jobName, parameters.agentOs) }}
|
||||
displayName: ${{ coalesce(parameters.jobDisplayName, parameters.agentOs) }}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@
|
|||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Razor" ProjectPath="$(RepoRoot)src\Razor\Razor\src\Microsoft.AspNetCore.Razor.csproj" RefProjectPath="$(RepoRoot)src\Razor\Razor\ref\Microsoft.AspNetCore.Razor.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Abstractions" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Abstractions\src\Microsoft.AspNetCore.Mvc.Abstractions.csproj" RefProjectPath="$(RepoRoot)src\Mvc\Mvc.Abstractions\ref\Microsoft.AspNetCore.Mvc.Abstractions.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.ApiExplorer" ProjectPath="$(RepoRoot)src\Mvc\Mvc.ApiExplorer\src\Microsoft.AspNetCore.Mvc.ApiExplorer.csproj" RefProjectPath="$(RepoRoot)src\Mvc\Mvc.ApiExplorer\ref\Microsoft.AspNetCore.Mvc.ApiExplorer.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Components.Prerendering" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Components.Prerendering\src\Microsoft.AspNetCore.Mvc.Components.Prerendering.csproj" RefProjectPath="$(RepoRoot)src\Mvc\Mvc.Components.Prerendering\ref\Microsoft.AspNetCore.Mvc.Components.Prerendering.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Core" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Core\src\Microsoft.AspNetCore.Mvc.Core.csproj" RefProjectPath="$(RepoRoot)src\Mvc\Mvc.Core\ref\Microsoft.AspNetCore.Mvc.Core.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Cors" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Cors\src\Microsoft.AspNetCore.Mvc.Cors.csproj" RefProjectPath="$(RepoRoot)src\Mvc\Mvc.Cors\ref\Microsoft.AspNetCore.Mvc.Cors.csproj" />
|
||||
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.DataAnnotations" ProjectPath="$(RepoRoot)src\Mvc\Mvc.DataAnnotations\src\Microsoft.AspNetCore.Mvc.DataAnnotations.csproj" RefProjectPath="$(RepoRoot)src\Mvc\Mvc.DataAnnotations\ref\Microsoft.AspNetCore.Mvc.DataAnnotations.csproj" />
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@
|
|||
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Razor" />
|
||||
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Mvc.Abstractions" />
|
||||
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" />
|
||||
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Mvc.Components.Prerendering" />
|
||||
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Mvc.Core" />
|
||||
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Mvc.Cors" />
|
||||
<AspNetCoreAppReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" />
|
||||
|
|
|
|||
|
|
@ -9,412 +9,412 @@
|
|||
-->
|
||||
<Dependencies>
|
||||
<ProductDependencies>
|
||||
<Dependency Name="Microsoft.AspNetCore.Blazor.Mono" Version="3.0.0-preview8.19380.1">
|
||||
<Dependency Name="Microsoft.AspNetCore.Blazor.Mono" Version="3.0.0-preview9.19379.2">
|
||||
<Uri>https://github.com/aspnet/Blazor</Uri>
|
||||
<Sha>2b834cef9e511554f9c580545a15d7107aea6cc0</Sha>
|
||||
<Sha>cd9254a05cfa52defeacd31697d25b2a4ed17510</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.Razor.Language" Version="3.0.0-preview8.19381.3">
|
||||
<Dependency Name="Microsoft.AspNetCore.Razor.Language" Version="3.0.0-preview9.19402.1">
|
||||
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
|
||||
<Sha>3cbb59559b5c0488bab471c0b8c0f2ecf14d5767</Sha>
|
||||
<Sha>f039aa935462163dead64ca2d6f9c6d27f4e290b</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="3.0.0-preview8.19381.3">
|
||||
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="3.0.0-preview9.19402.1">
|
||||
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
|
||||
<Sha>3cbb59559b5c0488bab471c0b8c0f2ecf14d5767</Sha>
|
||||
<Sha>f039aa935462163dead64ca2d6f9c6d27f4e290b</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.CodeAnalysis.Razor" Version="3.0.0-preview8.19381.3">
|
||||
<Dependency Name="Microsoft.CodeAnalysis.Razor" Version="3.0.0-preview9.19402.1">
|
||||
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
|
||||
<Sha>3cbb59559b5c0488bab471c0b8c0f2ecf14d5767</Sha>
|
||||
<Sha>f039aa935462163dead64ca2d6f9c6d27f4e290b</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.NET.Sdk.Razor" Version="3.0.0-preview8.19381.3">
|
||||
<Dependency Name="Microsoft.NET.Sdk.Razor" Version="3.0.0-preview9.19402.1">
|
||||
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
|
||||
<Sha>3cbb59559b5c0488bab471c0b8c0f2ecf14d5767</Sha>
|
||||
<Sha>f039aa935462163dead64ca2d6f9c6d27f4e290b</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="dotnet-ef" Version="3.0.0-preview8.19381.5">
|
||||
<Dependency Name="dotnet-ef" Version="3.0.0-preview9.19402.9">
|
||||
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
|
||||
<Sha>d85ecc7c184862042033e38bee331b81fb6145d5</Sha>
|
||||
<Sha>49f9f7632c742108e5652f182922cc35c19c9162</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.0-preview8.19381.5">
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.0-preview9.19402.9">
|
||||
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
|
||||
<Sha>d85ecc7c184862042033e38bee331b81fb6145d5</Sha>
|
||||
<Sha>49f9f7632c742108e5652f182922cc35c19c9162</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="3.0.0-preview8.19381.5">
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="3.0.0-preview9.19402.9">
|
||||
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
|
||||
<Sha>d85ecc7c184862042033e38bee331b81fb6145d5</Sha>
|
||||
<Sha>49f9f7632c742108e5652f182922cc35c19c9162</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0-preview8.19381.5">
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0-preview9.19402.9">
|
||||
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
|
||||
<Sha>d85ecc7c184862042033e38bee331b81fb6145d5</Sha>
|
||||
<Sha>49f9f7632c742108e5652f182922cc35c19c9162</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview8.19381.5">
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview9.19402.9">
|
||||
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
|
||||
<Sha>d85ecc7c184862042033e38bee331b81fb6145d5</Sha>
|
||||
<Sha>49f9f7632c742108e5652f182922cc35c19c9162</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview8.19381.5">
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview9.19402.9">
|
||||
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
|
||||
<Sha>d85ecc7c184862042033e38bee331b81fb6145d5</Sha>
|
||||
<Sha>49f9f7632c742108e5652f182922cc35c19c9162</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore" Version="3.0.0-preview8.19381.5">
|
||||
<Dependency Name="Microsoft.EntityFrameworkCore" Version="3.0.0-preview9.19402.9">
|
||||
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
|
||||
<Sha>d85ecc7c184862042033e38bee331b81fb6145d5</Sha>
|
||||
<Sha>49f9f7632c742108e5652f182922cc35c19c9162</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.Analyzer.Testing" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.AspNetCore.Analyzer.Testing" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.BenchmarkRunner.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.AspNetCore.BenchmarkRunner.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.ActivatorUtilities.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.ActivatorUtilities.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Caching.Memory" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Caching.Memory" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Caching.SqlServer" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Caching.SqlServer" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.CommandLineUtils.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.CommandLineUtils.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Json" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Json" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.KeyPerFile" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.KeyPerFile" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Configuration" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Configuration" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.DependencyInjection" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.DependencyInjection" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.DiagnosticAdapter" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.DiagnosticAdapter" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.HashCodeCombiner.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.HashCodeCombiner.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Hosting" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Hosting" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Http" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Http" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Localization.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Localization.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Localization" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Localization" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.AzureAppServices" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.AzureAppServices" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Console" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Console" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Debug" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Debug" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.EventLog" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.EventLog" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Testing" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging.Testing" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Logging" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Logging" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.ObjectPool" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.ObjectPool" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Options" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Options" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.ParameterDefaultValue.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.ParameterDefaultValue.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.Primitives" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.Primitives" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.TypeNameHelper.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.TypeNameHelper.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.ValueStopwatch.Sources" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.ValueStopwatch.Sources" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.WebEncoders" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Extensions.WebEncoders" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Internal.Extensions.Refs" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.Internal.Extensions.Refs" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.JSInterop" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.JSInterop" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Mono.WebAssembly.Interop" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Mono.WebAssembly.Interop" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.CSharp" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="Microsoft.CSharp" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Win32.SystemEvents" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="Microsoft.Win32.SystemEvents" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.ComponentModel.Annotations" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.ComponentModel.Annotations" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Data.SqlClient" Version="4.7.0-preview6.19264.9" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64" Pinned="true">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>a28176b5ec68b6da1472934fe9493790d1665cae</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Drawing.Common" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Drawing.Common" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.IO.Pipelines" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.IO.Pipelines" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Net.Http.WinHttpHandler" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Net.Http.WinHttpHandler" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Net.WebSockets.WebSocketProtocol" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Net.WebSockets.WebSocketProtocol" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Reflection.Metadata" Version="1.7.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Reflection.Metadata" Version="1.7.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Runtime.CompilerServices.Unsafe" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Runtime.CompilerServices.Unsafe" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Cryptography.Cng" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Security.Cryptography.Cng" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Cryptography.Pkcs" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Security.Cryptography.Pkcs" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.ServiceProcess.ServiceController" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.ServiceProcess.ServiceController" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Text.Encodings.Web" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Text.Encodings.Web" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Text.Json" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Text.Json" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Threading.Channels" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Threading.Channels" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Windows.Extensions" Version="4.6.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="System.Windows.Extensions" Version="4.6.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="3.0.0-preview8-28380-08" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="3.0.0-preview8-28379-05" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Uri>https://github.com/dotnet/core-setup</Uri>
|
||||
<Sha>c855ac718789051d5d67282c88decca445de7711</Sha>
|
||||
<Sha>d15a0adeb874801e7bfaa4fbbb306a2efa268497</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.NETCore.App.Ref" Version="3.0.0-preview8-28380-08" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Dependency Name="Microsoft.NETCore.App.Ref" Version="3.0.0-preview8-28379-05" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Uri>https://github.com/dotnet/core-setup</Uri>
|
||||
<Sha>c855ac718789051d5d67282c88decca445de7711</Sha>
|
||||
<Sha>d15a0adeb874801e7bfaa4fbbb306a2efa268497</Sha>
|
||||
</Dependency>
|
||||
<!--
|
||||
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
|
||||
All Runtime.$rid packages should have the same version.
|
||||
-->
|
||||
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="3.0.0-preview8-28380-08" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="3.0.0-preview8-28379-05" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Uri>https://github.com/dotnet/core-setup</Uri>
|
||||
<Sha>c855ac718789051d5d67282c88decca445de7711</Sha>
|
||||
<Sha>d15a0adeb874801e7bfaa4fbbb306a2efa268497</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="NETStandard.Library.Ref" Version="2.1.0-preview8-28380-08" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Dependency Name="NETStandard.Library.Ref" Version="2.1.0-preview8-28379-05" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Uri>https://github.com/dotnet/core-setup</Uri>
|
||||
<Sha>c855ac718789051d5d67282c88decca445de7711</Sha>
|
||||
<Sha>d15a0adeb874801e7bfaa4fbbb306a2efa268497</Sha>
|
||||
</Dependency>
|
||||
</ProductDependencies>
|
||||
<ToolsetDependencies>
|
||||
<!-- Listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
|
||||
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview8.19379.7" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview8.19378.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7c56101d1829e8f317065f99d173834c38c2ec44</Sha>
|
||||
<Sha>80f411d58df8338ccd9430900b541a037a9cb383</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Internal.AspNetCore.Analyzers" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Internal.AspNetCore.Analyzers" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.GenAPI" Version="1.0.0-beta.19369.2">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
|
|
@ -428,13 +428,13 @@
|
|||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>a190d4865fe3c86a168ec49c4fc61c90c96ae051</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.AspNetCore.Testing" Version="3.0.0-preview8.19381.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Dependency Name="Microsoft.AspNetCore.Testing" Version="3.0.0-preview9.19401.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
|
||||
<Uri>https://github.com/aspnet/Extensions</Uri>
|
||||
<Sha>dea3f207c8ea27f2a13ab15880df58ff91b42dfa</Sha>
|
||||
<Sha>54d000fda95c2c1f05b13a2e910fc91994da8eb8</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="3.3.0-beta2-19381-14" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="3.3.0-beta3-19401-01" CoherentParentDependency="Microsoft.Extensions.Logging">
|
||||
<Uri>https://github.com/dotnet/roslyn</Uri>
|
||||
<Sha>ef3a7a3863ae53b610a4b0c3682a35cad0829583</Sha>
|
||||
<Sha>e9b4c66fb2f26bca02d4a718c48c1c39e9963c9f</Sha>
|
||||
</Dependency>
|
||||
</ToolsetDependencies>
|
||||
</Dependencies>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<AspNetCoreMajorVersion>3</AspNetCoreMajorVersion>
|
||||
<AspNetCoreMinorVersion>0</AspNetCoreMinorVersion>
|
||||
<AspNetCorePatchVersion>0</AspNetCorePatchVersion>
|
||||
<PreReleasePreviewNumber>8</PreReleasePreviewNumber>
|
||||
<PreReleasePreviewNumber>9</PreReleasePreviewNumber>
|
||||
<PreReleaseVersionLabel>preview$(PreReleasePreviewNumber)</PreReleaseVersionLabel>
|
||||
<PreReleaseBrandingLabel>Preview $(PreReleasePreviewNumber)</PreReleaseBrandingLabel>
|
||||
<AspNetCoreMajorMinorVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion)</AspNetCoreMajorMinorVersion>
|
||||
|
|
@ -52,115 +52,115 @@
|
|||
<!-- Packages from dotnet/arcade -->
|
||||
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19369.2</MicrosoftDotNetGenAPIPackageVersion>
|
||||
<!-- Packages from dotnet/roslyn -->
|
||||
<MicrosoftNetCompilersToolsetPackageVersion>3.3.0-beta2-19381-14</MicrosoftNetCompilersToolsetPackageVersion>
|
||||
<MicrosoftNetCompilersToolsetPackageVersion>3.3.0-beta3-19401-01</MicrosoftNetCompilersToolsetPackageVersion>
|
||||
<!-- Packages from dotnet/core-setup -->
|
||||
<MicrosoftExtensionsDependencyModelPackageVersion>3.0.0-preview8-28380-08</MicrosoftExtensionsDependencyModelPackageVersion>
|
||||
<MicrosoftNETCoreAppRefPackageVersion>3.0.0-preview8-28380-08</MicrosoftNETCoreAppRefPackageVersion>
|
||||
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.0.0-preview8-28380-08</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
|
||||
<NETStandardLibraryRefPackageVersion>2.1.0-preview8-28380-08</NETStandardLibraryRefPackageVersion>
|
||||
<MicrosoftExtensionsDependencyModelPackageVersion>3.0.0-preview8-28379-05</MicrosoftExtensionsDependencyModelPackageVersion>
|
||||
<MicrosoftNETCoreAppRefPackageVersion>3.0.0-preview8-28379-05</MicrosoftNETCoreAppRefPackageVersion>
|
||||
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.0.0-preview8-28379-05</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
|
||||
<NETStandardLibraryRefPackageVersion>2.1.0-preview8-28379-05</NETStandardLibraryRefPackageVersion>
|
||||
<!-- Packages from dotnet/corefx -->
|
||||
<MicrosoftBclAsyncInterfacesPackageVersion>1.0.0-preview8.19379.7</MicrosoftBclAsyncInterfacesPackageVersion>
|
||||
<MicrosoftCSharpPackageVersion>4.6.0-preview8.19379.7</MicrosoftCSharpPackageVersion>
|
||||
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview8.19379.7</MicrosoftWin32RegistryPackageVersion>
|
||||
<MicrosoftWin32SystemEventsPackageVersion>4.6.0-preview8.19379.7</MicrosoftWin32SystemEventsPackageVersion>
|
||||
<SystemComponentModelAnnotationsPackageVersion>4.6.0-preview8.19379.7</SystemComponentModelAnnotationsPackageVersion>
|
||||
<MicrosoftBclAsyncInterfacesPackageVersion>1.0.0-preview8.19378.8</MicrosoftBclAsyncInterfacesPackageVersion>
|
||||
<MicrosoftCSharpPackageVersion>4.6.0-preview8.19378.8</MicrosoftCSharpPackageVersion>
|
||||
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview8.19378.8</MicrosoftWin32RegistryPackageVersion>
|
||||
<MicrosoftWin32SystemEventsPackageVersion>4.6.0-preview8.19378.8</MicrosoftWin32SystemEventsPackageVersion>
|
||||
<SystemComponentModelAnnotationsPackageVersion>4.6.0-preview8.19378.8</SystemComponentModelAnnotationsPackageVersion>
|
||||
<SystemDataSqlClientPackageVersion>4.7.0-preview6.19264.9</SystemDataSqlClientPackageVersion>
|
||||
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview8.19379.7</SystemDiagnosticsEventLogPackageVersion>
|
||||
<SystemDrawingCommonPackageVersion>4.6.0-preview8.19379.7</SystemDrawingCommonPackageVersion>
|
||||
<SystemIOPipelinesPackageVersion>4.6.0-preview8.19379.7</SystemIOPipelinesPackageVersion>
|
||||
<SystemNetHttpWinHttpHandlerPackageVersion>4.6.0-preview8.19379.7</SystemNetHttpWinHttpHandlerPackageVersion>
|
||||
<SystemNetWebSocketsWebSocketProtocolPackageVersion>4.6.0-preview8.19379.7</SystemNetWebSocketsWebSocketProtocolPackageVersion>
|
||||
<SystemReflectionMetadataPackageVersion>1.7.0-preview8.19379.7</SystemReflectionMetadataPackageVersion>
|
||||
<SystemRuntimeCompilerServicesUnsafePackageVersion>4.6.0-preview8.19379.7</SystemRuntimeCompilerServicesUnsafePackageVersion>
|
||||
<SystemSecurityCryptographyCngPackageVersion>4.6.0-preview8.19379.7</SystemSecurityCryptographyCngPackageVersion>
|
||||
<SystemSecurityCryptographyPkcsPackageVersion>4.6.0-preview8.19379.7</SystemSecurityCryptographyPkcsPackageVersion>
|
||||
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview8.19379.7</SystemSecurityCryptographyXmlPackageVersion>
|
||||
<SystemSecurityPermissionsPackageVersion>4.6.0-preview8.19379.7</SystemSecurityPermissionsPackageVersion>
|
||||
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview8.19379.7</SystemSecurityPrincipalWindowsPackageVersion>
|
||||
<SystemServiceProcessServiceControllerPackageVersion>4.6.0-preview8.19379.7</SystemServiceProcessServiceControllerPackageVersion>
|
||||
<SystemTextEncodingsWebPackageVersion>4.6.0-preview8.19379.7</SystemTextEncodingsWebPackageVersion>
|
||||
<SystemTextJsonPackageVersion>4.6.0-preview8.19379.7</SystemTextJsonPackageVersion>
|
||||
<SystemThreadingChannelsPackageVersion>4.6.0-preview8.19379.7</SystemThreadingChannelsPackageVersion>
|
||||
<SystemWindowsExtensionsPackageVersion>4.6.0-preview8.19379.7</SystemWindowsExtensionsPackageVersion>
|
||||
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview8.19378.8</SystemDiagnosticsEventLogPackageVersion>
|
||||
<SystemDrawingCommonPackageVersion>4.6.0-preview8.19378.8</SystemDrawingCommonPackageVersion>
|
||||
<SystemIOPipelinesPackageVersion>4.6.0-preview8.19378.8</SystemIOPipelinesPackageVersion>
|
||||
<SystemNetHttpWinHttpHandlerPackageVersion>4.6.0-preview8.19378.8</SystemNetHttpWinHttpHandlerPackageVersion>
|
||||
<SystemNetWebSocketsWebSocketProtocolPackageVersion>4.6.0-preview8.19378.8</SystemNetWebSocketsWebSocketProtocolPackageVersion>
|
||||
<SystemReflectionMetadataPackageVersion>1.7.0-preview8.19378.8</SystemReflectionMetadataPackageVersion>
|
||||
<SystemRuntimeCompilerServicesUnsafePackageVersion>4.6.0-preview8.19378.8</SystemRuntimeCompilerServicesUnsafePackageVersion>
|
||||
<SystemSecurityCryptographyCngPackageVersion>4.6.0-preview8.19378.8</SystemSecurityCryptographyCngPackageVersion>
|
||||
<SystemSecurityCryptographyPkcsPackageVersion>4.6.0-preview8.19378.8</SystemSecurityCryptographyPkcsPackageVersion>
|
||||
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview8.19378.8</SystemSecurityCryptographyXmlPackageVersion>
|
||||
<SystemSecurityPermissionsPackageVersion>4.6.0-preview8.19378.8</SystemSecurityPermissionsPackageVersion>
|
||||
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview8.19378.8</SystemSecurityPrincipalWindowsPackageVersion>
|
||||
<SystemServiceProcessServiceControllerPackageVersion>4.6.0-preview8.19378.8</SystemServiceProcessServiceControllerPackageVersion>
|
||||
<SystemTextEncodingsWebPackageVersion>4.6.0-preview8.19378.8</SystemTextEncodingsWebPackageVersion>
|
||||
<SystemTextJsonPackageVersion>4.6.0-preview8.19378.8</SystemTextJsonPackageVersion>
|
||||
<SystemThreadingChannelsPackageVersion>4.6.0-preview8.19378.8</SystemThreadingChannelsPackageVersion>
|
||||
<SystemWindowsExtensionsPackageVersion>4.6.0-preview8.19378.8</SystemWindowsExtensionsPackageVersion>
|
||||
<!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
|
||||
<MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview8.19379.7</MicrosoftNETCorePlatformsPackageVersion>
|
||||
<MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview8.19378.8</MicrosoftNETCorePlatformsPackageVersion>
|
||||
<!-- Packages from aspnet/Blazor -->
|
||||
<MicrosoftAspNetCoreBlazorMonoPackageVersion>3.0.0-preview8.19380.1</MicrosoftAspNetCoreBlazorMonoPackageVersion>
|
||||
<MicrosoftAspNetCoreBlazorMonoPackageVersion>3.0.0-preview9.19379.2</MicrosoftAspNetCoreBlazorMonoPackageVersion>
|
||||
<!-- Packages from aspnet/Extensions -->
|
||||
<InternalAspNetCoreAnalyzersPackageVersion>3.0.0-preview8.19381.3</InternalAspNetCoreAnalyzersPackageVersion>
|
||||
<MicrosoftAspNetCoreAnalyzerTestingPackageVersion>3.0.0-preview8.19381.3</MicrosoftAspNetCoreAnalyzerTestingPackageVersion>
|
||||
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
|
||||
<MicrosoftAspNetCoreTestingPackageVersion>3.0.0-preview8.19381.3</MicrosoftAspNetCoreTestingPackageVersion>
|
||||
<MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>
|
||||
<MicrosoftExtensionsCachingAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsCachingAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsCachingMemoryPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsCachingMemoryPackageVersion>
|
||||
<MicrosoftExtensionsCachingSqlServerPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsCachingSqlServerPackageVersion>
|
||||
<MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>
|
||||
<MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationBinderPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationBinderPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationIniPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationIniPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationUserSecretsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationXmlPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsConfigurationXmlPackageVersion>
|
||||
<MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsDependencyInjectionPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
||||
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
||||
<MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersCompositePackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsFileProvidersCompositePackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
|
||||
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
|
||||
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
|
||||
<MicrosoftExtensionsHostingAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsHostingAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsHostingPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsHostingPackageVersion>
|
||||
<MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>
|
||||
<MicrosoftExtensionsHttpPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsHttpPackageVersion>
|
||||
<MicrosoftExtensionsLocalizationAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLocalizationAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsLocalizationPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLocalizationPackageVersion>
|
||||
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConfigurationPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConsolePackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||
<MicrosoftExtensionsLoggingDebugPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingDebugPackageVersion>
|
||||
<MicrosoftExtensionsLoggingEventSourcePackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingEventSourcePackageVersion>
|
||||
<MicrosoftExtensionsLoggingEventLogPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingEventLogPackageVersion>
|
||||
<MicrosoftExtensionsLoggingPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTestingPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTraceSourcePackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsLoggingTraceSourcePackageVersion>
|
||||
<MicrosoftExtensionsObjectPoolPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsObjectPoolPackageVersion>
|
||||
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>
|
||||
<MicrosoftExtensionsOptionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsOptionsPackageVersion>
|
||||
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
|
||||
<MicrosoftExtensionsPrimitivesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsPrimitivesPackageVersion>
|
||||
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
|
||||
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
|
||||
<MicrosoftExtensionsWebEncodersPackageVersion>3.0.0-preview8.19381.3</MicrosoftExtensionsWebEncodersPackageVersion>
|
||||
<MicrosoftInternalExtensionsRefsPackageVersion>3.0.0-preview8.19381.3</MicrosoftInternalExtensionsRefsPackageVersion>
|
||||
<MicrosoftJSInteropPackageVersion>3.0.0-preview8.19381.3</MicrosoftJSInteropPackageVersion>
|
||||
<MonoWebAssemblyInteropPackageVersion>3.0.0-preview8.19381.3</MonoWebAssemblyInteropPackageVersion>
|
||||
<InternalAspNetCoreAnalyzersPackageVersion>3.0.0-preview9.19401.2</InternalAspNetCoreAnalyzersPackageVersion>
|
||||
<MicrosoftAspNetCoreAnalyzerTestingPackageVersion>3.0.0-preview9.19401.2</MicrosoftAspNetCoreAnalyzerTestingPackageVersion>
|
||||
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
|
||||
<MicrosoftAspNetCoreTestingPackageVersion>3.0.0-preview9.19401.2</MicrosoftAspNetCoreTestingPackageVersion>
|
||||
<MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>
|
||||
<MicrosoftExtensionsCachingAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsCachingAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsCachingMemoryPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsCachingMemoryPackageVersion>
|
||||
<MicrosoftExtensionsCachingSqlServerPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsCachingSqlServerPackageVersion>
|
||||
<MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>
|
||||
<MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationBinderPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationBinderPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationIniPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationIniPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationUserSecretsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationXmlPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsConfigurationXmlPackageVersion>
|
||||
<MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsDependencyInjectionPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
||||
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
||||
<MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersCompositePackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsFileProvidersCompositePackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
|
||||
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
|
||||
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
|
||||
<MicrosoftExtensionsHostingAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsHostingAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsHostingPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsHostingPackageVersion>
|
||||
<MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>
|
||||
<MicrosoftExtensionsHttpPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsHttpPackageVersion>
|
||||
<MicrosoftExtensionsLocalizationAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLocalizationAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsLocalizationPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLocalizationPackageVersion>
|
||||
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
|
||||
<MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConfigurationPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConsolePackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||
<MicrosoftExtensionsLoggingDebugPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingDebugPackageVersion>
|
||||
<MicrosoftExtensionsLoggingEventSourcePackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingEventSourcePackageVersion>
|
||||
<MicrosoftExtensionsLoggingEventLogPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingEventLogPackageVersion>
|
||||
<MicrosoftExtensionsLoggingPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTestingPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTraceSourcePackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsLoggingTraceSourcePackageVersion>
|
||||
<MicrosoftExtensionsObjectPoolPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsObjectPoolPackageVersion>
|
||||
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>
|
||||
<MicrosoftExtensionsOptionsPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsOptionsPackageVersion>
|
||||
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
|
||||
<MicrosoftExtensionsPrimitivesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsPrimitivesPackageVersion>
|
||||
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
|
||||
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
|
||||
<MicrosoftExtensionsWebEncodersPackageVersion>3.0.0-preview9.19401.2</MicrosoftExtensionsWebEncodersPackageVersion>
|
||||
<MicrosoftInternalExtensionsRefsPackageVersion>3.0.0-preview9.19401.2</MicrosoftInternalExtensionsRefsPackageVersion>
|
||||
<MicrosoftJSInteropPackageVersion>3.0.0-preview9.19401.2</MicrosoftJSInteropPackageVersion>
|
||||
<MonoWebAssemblyInteropPackageVersion>3.0.0-preview9.19401.2</MonoWebAssemblyInteropPackageVersion>
|
||||
<!-- Packages from aspnet/EntityFrameworkCore -->
|
||||
<dotnetefPackageVersion>3.0.0-preview8.19381.5</dotnetefPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>3.0.0-preview8.19381.5</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>3.0.0-preview8.19381.5</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreSqlitePackageVersion>3.0.0-preview8.19381.5</MicrosoftEntityFrameworkCoreSqlitePackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>3.0.0-preview8.19381.5</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreToolsPackageVersion>3.0.0-preview8.19381.5</MicrosoftEntityFrameworkCoreToolsPackageVersion>
|
||||
<MicrosoftEntityFrameworkCorePackageVersion>3.0.0-preview8.19381.5</MicrosoftEntityFrameworkCorePackageVersion>
|
||||
<dotnetefPackageVersion>3.0.0-preview9.19402.9</dotnetefPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>3.0.0-preview9.19402.9</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>3.0.0-preview9.19402.9</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreSqlitePackageVersion>3.0.0-preview9.19402.9</MicrosoftEntityFrameworkCoreSqlitePackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>3.0.0-preview9.19402.9</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreToolsPackageVersion>3.0.0-preview9.19402.9</MicrosoftEntityFrameworkCoreToolsPackageVersion>
|
||||
<MicrosoftEntityFrameworkCorePackageVersion>3.0.0-preview9.19402.9</MicrosoftEntityFrameworkCorePackageVersion>
|
||||
<!-- Packages from aspnet/AspNetCore-Tooling -->
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>3.0.0-preview8.19381.3</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
|
||||
<MicrosoftAspNetCoreRazorLanguagePackageVersion>3.0.0-preview8.19381.3</MicrosoftAspNetCoreRazorLanguagePackageVersion>
|
||||
<MicrosoftCodeAnalysisRazorPackageVersion>3.0.0-preview8.19381.3</MicrosoftCodeAnalysisRazorPackageVersion>
|
||||
<MicrosoftNETSdkRazorPackageVersion>3.0.0-preview8.19381.3</MicrosoftNETSdkRazorPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>3.0.0-preview9.19402.1</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
|
||||
<MicrosoftAspNetCoreRazorLanguagePackageVersion>3.0.0-preview9.19402.1</MicrosoftAspNetCoreRazorLanguagePackageVersion>
|
||||
<MicrosoftCodeAnalysisRazorPackageVersion>3.0.0-preview9.19402.1</MicrosoftCodeAnalysisRazorPackageVersion>
|
||||
<MicrosoftNETSdkRazorPackageVersion>3.0.0-preview9.19402.1</MicrosoftNETSdkRazorPackageVersion>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
|
||||
|
|
|
|||
|
|
@ -43,4 +43,9 @@
|
|||
This one sets UseSharedCompilation to false by default. -->
|
||||
<UseSharedCompilation>true</UseSharedCompilation>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Ignore warning about calling the Pack target on Web SDK projects. Our build scripts call /t:pack on everything in this repo. -->
|
||||
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -15,11 +15,6 @@
|
|||
<BundledNETCorePlatformsPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</BundledNETCorePlatformsPackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Workaround https://github.com/aspnet/AspNetCore/issues/7503. This chains GenerateSourceLinkFile before razor component targets run. -->
|
||||
<!-- Workaround https://github.com/dotnet/source-build/issues/1112. Source link is currently disabled in source build so do not apply this worksaround. -->
|
||||
<Target Condition="'$(DotNetBuildFromSource)' != 'true'"
|
||||
|
|
@ -30,12 +25,6 @@
|
|||
<!-- Workaround https://github.com/dotnet/source-build/issues/1112. Source link is currently disabled in source build so define this dummy target which is required for pack. -->
|
||||
<Import Condition="'$(DotNetBuildFromSource)' == 'true'" Project="WorkaroundsImported.targets" />
|
||||
|
||||
<!-- Workaround https://github.com/aspnet/websdk/pull/646. If merged, once we update to a websdk with this fix, we can move the setting below to Directory.Build.props. -->
|
||||
<PropertyGroup>
|
||||
<!-- Ignore warning about calling the Pack target on Web SDK projects. Our build scripts call /t:pack on everything in this repo. -->
|
||||
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Workaround for https://github.com/dotnet/arcade/issues/204 -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Internal.AspNetCore.BuildTasks" PrivateAssets="All" Version="$(InternalAspNetCoreBuildTasksPackageVersion)" IsImplicitlyDefined="true" />
|
||||
|
|
@ -54,21 +43,6 @@
|
|||
</KnownFrameworkReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Workaround until we can build our repo with a 3.0 Preview 7 SDK which has https://github.com/dotnet/core-sdk/pull/2401. -->
|
||||
<ItemGroup Condition="'$(PreReleasePreviewNumber)' == '7' ">
|
||||
<KnownFrameworkReference Update="Microsoft.NETCore.App">
|
||||
<!--
|
||||
Temporary until we can update to build with the Preview7 SDK .
|
||||
Using PreReleasePreviewNumber to time-bomb this so we can remove this before RTM.
|
||||
|
||||
This workaround was also applied to src\ProjectTemplates\test\Infrastructure\TemplateTests.props.in.
|
||||
-->
|
||||
<RuntimePackNamePatterns>Microsoft.NETCore.App.Runtime.**RID**</RuntimePackNamePatterns>
|
||||
<AppHostPackNamePattern />
|
||||
<AppHostRuntimeIdentifiers />
|
||||
</KnownFrameworkReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Work around https://github.com/dotnet/cli/issues/11378. -->
|
||||
<Target Name="_WorkaroundNetStandard" AfterTargets="ResolvePackageAssets">
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,12 @@ namespace Microsoft.AspNetCore.Analyzers.TestFiles.CompilationFeatureDetectorTes
|
|||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapBlazorHub();
|
||||
endpoints.MapBlazorHub<App>("app");
|
||||
});
|
||||
}
|
||||
|
||||
public class App : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
new LocalizableResourceString(nameof(Resources.ComponentParameterSettersShouldBePublic_Title), Resources.ResourceManager, typeof(Resources)),
|
||||
new LocalizableResourceString(nameof(Resources.ComponentParameterSettersShouldBePublic_Format), Resources.ResourceManager, typeof(Resources)),
|
||||
"Encapsulation",
|
||||
DiagnosticSeverity.Warning,
|
||||
DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: new LocalizableResourceString(nameof(Resources.ComponentParameterSettersShouldBePublic_Description), Resources.ResourceManager, typeof(Resources)));
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
new LocalizableResourceString(nameof(Resources.ComponentParameterShouldBePublic_Title), Resources.ResourceManager, typeof(Resources)),
|
||||
new LocalizableResourceString(nameof(Resources.ComponentParameterShouldBePublic_Format), Resources.ResourceManager, typeof(Resources)),
|
||||
"Encapsulation",
|
||||
DiagnosticSeverity.Warning,
|
||||
DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: new LocalizableResourceString(nameof(Resources.ComponentParametersShouldBePublic_Description), Resources.ResourceManager, typeof(Resources)));
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty1' should have a public setter.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 7, 39)
|
||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty2' should have a public setter.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 8, 39)
|
||||
|
|
@ -98,7 +98,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty3' should have a public setter.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 9, 39)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.BadProperty1' should be public.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 8, 40)
|
||||
|
|
@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty1' should have a public setter.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 8, 39)
|
||||
|
|
@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty2' should have a public setter.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 9, 39)
|
||||
|
|
@ -105,7 +105,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParameterSettersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty3' should have a public setter.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 10, 39)
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty1' should be public.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 7, 32)
|
||||
|
|
@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty2' should be public.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 8, 40)
|
||||
|
|
@ -83,7 +83,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty3' should be public.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 9, 42)
|
||||
|
|
@ -93,7 +93,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
|
|||
{
|
||||
Id = DiagnosticDescriptors.ComponentParametersShouldBePublic.Id,
|
||||
Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty4' should be public.",
|
||||
Severity = DiagnosticSeverity.Warning,
|
||||
Severity = DiagnosticSeverity.Error,
|
||||
Locations = new[]
|
||||
{
|
||||
new DiagnosticResultLocation("Test0.cs", 10, 41)
|
||||
|
|
|
|||
|
|
@ -1,6 +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.
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor
|
||||
{
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
||||
public static partial class JSInteropMethods
|
||||
{
|
||||
[Microsoft.JSInterop.JSInvokableAttribute("NotifyLocationChanged")]
|
||||
public static void NotifyLocationChanged(string uri, bool isInterceptedLink) { }
|
||||
}
|
||||
}
|
||||
namespace Microsoft.AspNetCore.Blazor.Hosting
|
||||
{
|
||||
public static partial class BlazorWebAssemblyHost
|
||||
|
|
@ -62,24 +71,12 @@ namespace Microsoft.AspNetCore.Blazor.Rendering
|
|||
public override Microsoft.AspNetCore.Components.Dispatcher Dispatcher { get { throw null; } }
|
||||
public System.Threading.Tasks.Task AddComponentAsync(System.Type componentType, string domElementSelector) { throw null; }
|
||||
public System.Threading.Tasks.Task AddComponentAsync<TComponent>(string domElementSelector) where TComponent : Microsoft.AspNetCore.Components.IComponent { throw null; }
|
||||
public override System.Threading.Tasks.Task DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.Rendering.EventFieldInfo eventFieldInfo, Microsoft.AspNetCore.Components.UIEventArgs eventArgs) { throw null; }
|
||||
public override System.Threading.Tasks.Task DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.Rendering.EventFieldInfo eventFieldInfo, System.EventArgs eventArgs) { throw null; }
|
||||
protected override void Dispose(bool disposing) { }
|
||||
protected override void HandleException(System.Exception exception) { }
|
||||
protected override System.Threading.Tasks.Task UpdateDisplayAsync(in Microsoft.AspNetCore.Components.Rendering.RenderBatch batch) { throw null; }
|
||||
}
|
||||
}
|
||||
namespace Microsoft.AspNetCore.Blazor.Services
|
||||
{
|
||||
public partial class WebAssemblyUriHelper : Microsoft.AspNetCore.Components.UriHelperBase
|
||||
{
|
||||
internal WebAssemblyUriHelper() { }
|
||||
public static readonly Microsoft.AspNetCore.Blazor.Services.WebAssemblyUriHelper Instance;
|
||||
protected override void EnsureInitialized() { }
|
||||
protected override void NavigateToCore(string uri, bool forceLoad) { }
|
||||
[Microsoft.JSInterop.JSInvokableAttribute("NotifyLocationChanged")]
|
||||
public static void NotifyLocationChanged(string newAbsoluteUri, bool isInterceptedLink) { }
|
||||
}
|
||||
}
|
||||
namespace Microsoft.AspNetCore.Components.Builder
|
||||
{
|
||||
public static partial class ComponentsApplicationBuilderExtensions
|
||||
|
|
|
|||
|
|
@ -92,16 +92,16 @@ namespace Microsoft.AspNetCore.Blazor.Hosting
|
|||
services.AddSingleton<IWebAssemblyHost, WebAssemblyHost>();
|
||||
services.AddSingleton<IJSRuntime>(WebAssemblyJSRuntime.Instance);
|
||||
services.AddSingleton<IComponentContext, WebAssemblyComponentContext>();
|
||||
services.AddSingleton<IUriHelper>(WebAssemblyUriHelper.Instance);
|
||||
services.AddSingleton<NavigationManager>(WebAssemblyNavigationManager.Instance);
|
||||
services.AddSingleton<INavigationInterception>(WebAssemblyNavigationInterception.Instance);
|
||||
services.AddSingleton<ILoggerFactory, WebAssemblyLoggerFactory>();
|
||||
services.AddSingleton<HttpClient>(s =>
|
||||
{
|
||||
// Creating the URI helper needs to wait until the JS Runtime is initialized, so defer it.
|
||||
var uriHelper = s.GetRequiredService<IUriHelper>();
|
||||
var navigationManager = s.GetRequiredService<NavigationManager>();
|
||||
return new HttpClient
|
||||
{
|
||||
BaseAddress = new Uri(WebAssemblyUriHelper.Instance.GetBaseUri())
|
||||
BaseAddress = new Uri(navigationManager.BaseUri)
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
// 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.ComponentModel;
|
||||
using Microsoft.AspNetCore.Blazor.Services;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains methods called by interop. Intended for framework use only, not supported for use in application
|
||||
/// code.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static class JSInteropMethods
|
||||
{
|
||||
/// <summary>
|
||||
/// For framework use only.
|
||||
/// </summary>
|
||||
[JSInvokable(nameof(NotifyLocationChanged))]
|
||||
public static void NotifyLocationChanged(string uri, bool isInterceptedLink)
|
||||
{
|
||||
WebAssemblyNavigationManager.Instance.SetLocation(uri, isInterceptedLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ namespace Microsoft.AspNetCore.Blazor.Rendering
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, UIEventArgs eventArgs)
|
||||
public override Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, EventArgs eventArgs)
|
||||
{
|
||||
// Be sure we only run one event handler at once. Although they couldn't run
|
||||
// simultaneously anyway (there's only one thread), they could run nested on
|
||||
|
|
@ -185,10 +185,10 @@ namespace Microsoft.AspNetCore.Blazor.Rendering
|
|||
{
|
||||
public readonly ulong EventHandlerId;
|
||||
public readonly EventFieldInfo EventFieldInfo;
|
||||
public readonly UIEventArgs EventArgs;
|
||||
public readonly EventArgs EventArgs;
|
||||
public readonly TaskCompletionSource<object> TaskCompletionSource;
|
||||
|
||||
public IncomingEventInfo(ulong eventHandlerId, EventFieldInfo eventFieldInfo, UIEventArgs eventArgs)
|
||||
public IncomingEventInfo(ulong eventHandlerId, EventFieldInfo eventFieldInfo, EventArgs eventArgs)
|
||||
{
|
||||
EventHandlerId = eventHandlerId;
|
||||
EventFieldInfo = eventFieldInfo;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserUriHelperInterop;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserNavigationManagerInterop;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor.Services
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
// 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 Microsoft.AspNetCore.Components;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserNavigationManagerInterop;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Default client-side implementation of <see cref="NavigationManager"/>.
|
||||
/// </summary>
|
||||
internal class WebAssemblyNavigationManager : NavigationManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the instance of <see cref="WebAssemblyNavigationManager"/>.
|
||||
/// </summary>
|
||||
public static readonly WebAssemblyNavigationManager Instance = new WebAssemblyNavigationManager();
|
||||
|
||||
// For simplicity we force public consumption of the BrowserNavigationManager through
|
||||
// a singleton. Only a single instance can be updated by the browser through
|
||||
// interop. We can construct instances for testing.
|
||||
internal WebAssemblyNavigationManager()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void EnsureInitialized()
|
||||
{
|
||||
// As described in the comment block above, BrowserNavigationManager is only for
|
||||
// client-side (Mono) use, so it's OK to rely on synchronicity here.
|
||||
var baseUri = WebAssemblyJSRuntime.Instance.Invoke<string>(Interop.GetBaseUri);
|
||||
var uri = WebAssemblyJSRuntime.Instance.Invoke<string>(Interop.GetLocationHref);
|
||||
Initialize(baseUri, uri);
|
||||
}
|
||||
|
||||
public void SetLocation(string uri, bool isInterceptedLink)
|
||||
{
|
||||
Uri = uri;
|
||||
NotifyLocationChanged(isInterceptedLink);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void NavigateToCore(string uri, bool forceLoad)
|
||||
{
|
||||
if (uri == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(uri));
|
||||
}
|
||||
|
||||
WebAssemblyJSRuntime.Instance.Invoke<object>(Interop.NavigateTo, uri, forceLoad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,85 +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;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserUriHelperInterop;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Default client-side implementation of <see cref="IUriHelper"/>.
|
||||
/// </summary>
|
||||
public class WebAssemblyUriHelper : UriHelperBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the instance of <see cref="WebAssemblyUriHelper"/>.
|
||||
/// </summary>
|
||||
public static readonly WebAssemblyUriHelper Instance = new WebAssemblyUriHelper();
|
||||
|
||||
// For simplicity we force public consumption of the BrowserUriHelper through
|
||||
// a singleton. Only a single instance can be updated by the browser through
|
||||
// interop. We can construct instances for testing.
|
||||
internal WebAssemblyUriHelper()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void EnsureInitialized()
|
||||
{
|
||||
WebAssemblyJSRuntime.Instance.Invoke<object>(
|
||||
Interop.ListenForNavigationEvents,
|
||||
typeof(WebAssemblyUriHelper).Assembly.GetName().Name,
|
||||
nameof(NotifyLocationChanged));
|
||||
|
||||
// As described in the comment block above, BrowserUriHelper is only for
|
||||
// client-side (Mono) use, so it's OK to rely on synchronicity here.
|
||||
var baseUri = WebAssemblyJSRuntime.Instance.Invoke<string>(Interop.GetBaseUri);
|
||||
var uri = WebAssemblyJSRuntime.Instance.Invoke<string>(Interop.GetLocationHref);
|
||||
InitializeState(uri, baseUri);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void NavigateToCore(string uri, bool forceLoad)
|
||||
{
|
||||
if (uri == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(uri));
|
||||
}
|
||||
|
||||
WebAssemblyJSRuntime.Instance.Invoke<object>(Interop.NavigateTo, uri, forceLoad);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For framework use only.
|
||||
/// </summary>
|
||||
[JSInvokable(nameof(NotifyLocationChanged))]
|
||||
public static void NotifyLocationChanged(string newAbsoluteUri, bool isInterceptedLink)
|
||||
{
|
||||
Instance.SetAbsoluteUri(newAbsoluteUri);
|
||||
Instance.TriggerOnLocationChanged(isInterceptedLink);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given the document's document.baseURI value, returns the URI
|
||||
/// that can be prepended to relative URI paths to produce an absolute URI.
|
||||
/// This is computed by removing anything after the final slash.
|
||||
/// Internal for tests.
|
||||
/// </summary>
|
||||
/// <param name="absoluteBaseUri">The page's document.baseURI value.</param>
|
||||
/// <returns>The URI prefix</returns>
|
||||
internal static string ToBaseUri(string absoluteBaseUri)
|
||||
{
|
||||
if (absoluteBaseUri != null)
|
||||
{
|
||||
var lastSlashIndex = absoluteBaseUri.LastIndexOf('/');
|
||||
if (lastSlashIndex >= 0)
|
||||
{
|
||||
return absoluteBaseUri.Substring(0, lastSlashIndex + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return "/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +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;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor.Services.Test
|
||||
{
|
||||
public class WebAssemblyUriHelperTest
|
||||
{
|
||||
private WebAssemblyUriHelper _uriHelper = new WebAssemblyUriHelper();
|
||||
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "scheme://host/")]
|
||||
[InlineData("scheme://host:123/", "scheme://host:123/")]
|
||||
[InlineData("scheme://host/path", "scheme://host/")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/")]
|
||||
[InlineData("scheme://host/path/page?query=string&another=here", "scheme://host/path/")]
|
||||
public void ComputesCorrectBaseUri(string baseUri, string expectedResult)
|
||||
{
|
||||
var actualResult = WebAssemblyUriHelper.ToBaseUri(baseUri);
|
||||
Assert.Equal(expectedResult, actualResult);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "scheme://host", "")]
|
||||
[InlineData("scheme://host/", "scheme://host/", "")]
|
||||
[InlineData("scheme://host/", "scheme://host/path", "path")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/", "")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/more", "more")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path", "")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path#hash", "#hash")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/#hash", "#hash")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/more#hash", "more#hash")]
|
||||
public void ComputesCorrectValidBaseRelativePaths(string baseUri, string absoluteUri, string expectedResult)
|
||||
{
|
||||
var actualResult = _uriHelper.ToBaseRelativePath(baseUri, absoluteUri);
|
||||
Assert.Equal(expectedResult, actualResult);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "otherscheme://host/")]
|
||||
[InlineData("scheme://host/", "scheme://otherhost/")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/")]
|
||||
public void ThrowsForInvalidBaseRelativePaths(string baseUri, string absoluteUri)
|
||||
{
|
||||
var ex = Assert.Throws<ArgumentException>(() =>
|
||||
{
|
||||
_uriHelper.ToBaseRelativePath(baseUri, absoluteUri);
|
||||
});
|
||||
|
||||
Assert.Equal(
|
||||
$"The URI '{absoluteUri}' is not contained by the base URI '{baseUri}'.",
|
||||
ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,12 +46,11 @@
|
|||
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
|
||||
<UndefineProperties>TargetFramework</UndefineProperties>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\DevServer\src\Microsoft.AspNetCore.Blazor.DevServer.csproj">
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
<!-- Optimization. Do not require framework compatibility between these projects. -->
|
||||
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
|
||||
<UndefineProperties>TargetFramework</UndefineProperties>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- When referencing from source, we need to disable VS's fast up-to-date check,
|
||||
because otherwise changing the underlying Blazor library code isn't enough
|
||||
to make it rebuild the affected library apps. -->
|
||||
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ namespace Test
|
|||
public class MyComponent : ComponentBase
|
||||
{
|
||||
[Parameter]
|
||||
public Action<UIEventArgs> OnClick { get; set; }
|
||||
public Action<EventArgs> OnClick { get; set; }
|
||||
}
|
||||
}
|
||||
"));
|
||||
|
|
@ -263,7 +263,7 @@ namespace Test
|
|||
|
||||
@code {
|
||||
private int counter;
|
||||
private void Increment(UIEventArgs e) {
|
||||
private void Increment(EventArgs e) {
|
||||
counter++;
|
||||
}
|
||||
}");
|
||||
|
|
@ -280,7 +280,7 @@ namespace Test
|
|||
AssertFrame.Attribute(frame, "OnClick", 1);
|
||||
|
||||
// The handler will have been assigned to a lambda
|
||||
var handler = Assert.IsType<Action<UIEventArgs>>(frame.AttributeValue);
|
||||
var handler = Assert.IsType<Action<EventArgs>>(frame.AttributeValue);
|
||||
Assert.Equal("Test.TestComponent", handler.Target.GetType().FullName);
|
||||
Assert.Equal("Increment", handler.Method.Name);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
// Trigger the change event to show it updates the property
|
||||
//
|
||||
// This should always complete synchronously.
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new UIChangeEventArgs { Value = "Modified value", }));
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new ChangeEventArgs { Value = "Modified value", }));
|
||||
Assert.Equal(TaskStatus.RanToCompletion, task.Status);
|
||||
await task;
|
||||
|
||||
|
|
@ -367,7 +367,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
// Trigger the change event to show it updates the property
|
||||
//
|
||||
// This should always complete synchronously.
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new UIChangeEventArgs { Value = "Modified value", }));
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new ChangeEventArgs { Value = "Modified value", }));
|
||||
Assert.Equal(TaskStatus.RanToCompletion, task.Status);
|
||||
await task;
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
//
|
||||
// This should always complete synchronously.
|
||||
var newDateValue = new DateTime(2018, 3, 5, 4, 5, 6);
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new UIChangeEventArgs { Value = newDateValue.ToString(), }));
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new ChangeEventArgs { Value = newDateValue.ToString(), }));
|
||||
Assert.Equal(TaskStatus.RanToCompletion, task.Status);
|
||||
await task;
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
// Trigger the change event to show it updates the property
|
||||
//
|
||||
// This should always complete synchronously.
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new UIChangeEventArgs { Value = new DateTime(2018, 3, 5).ToString(testDateFormat), }));
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new ChangeEventArgs { Value = new DateTime(2018, 3, 5).ToString(testDateFormat), }));
|
||||
Assert.Equal(TaskStatus.RanToCompletion, task.Status);
|
||||
await task;
|
||||
|
||||
|
|
@ -559,7 +559,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
// Trigger the change event to show it updates the property
|
||||
//
|
||||
// This should always complete synchronously.
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new UIChangeEventArgs() { Value = false, }));
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new ChangeEventArgs() { Value = false, }));
|
||||
Assert.Equal(TaskStatus.RanToCompletion, task.Status);
|
||||
await task;
|
||||
|
||||
|
|
@ -595,7 +595,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
// Trigger the change event to show it updates the property
|
||||
//
|
||||
// This should always complete synchronously.
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new UIChangeEventArgs { Value = MyEnum.SecondValue.ToString(), }));
|
||||
var task = renderer.Dispatcher.InvokeAsync(() => setter.InvokeAsync(new ChangeEventArgs { Value = MyEnum.SecondValue.ToString(), }));
|
||||
Assert.Equal(TaskStatus.RanToCompletion, task.Status);
|
||||
await task;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<Project>
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<NuspecFile>Microsoft.AspNetCore.Blazor.Templates.nuspec</NuspecFile>
|
||||
|
|
@ -16,18 +15,31 @@
|
|||
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="TransformTemplateConfigs" BeforeTargets="CoreBuild" DependsOnTargets="SetTemplateJsonSymbolReplacements">
|
||||
<!--
|
||||
For each template, copy its '.template.config.src' directory to '.template.config',
|
||||
removing any earlier output at that location
|
||||
-->
|
||||
<ItemGroup>
|
||||
<UpToDateCheckInput Include="content\**\.template.config.src\**\*.*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PrepareFileLists" AfterTargets="PrepareForBuild">
|
||||
<ItemGroup>
|
||||
<_TemplateConfigMainFile Include="content\**\.template.config.src\template.json" />
|
||||
<_TemplateConfigDir Include="@(_TemplateConfigMainFile->'$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigMainFile.FullPath)'))')" />
|
||||
<_TemplateConfigDir Include="@(_TemplateConfigMainFile->'$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigMainFile.FullPath)'))')" />
|
||||
<_TemplateConfigFileToCopy Include="%(_TemplateConfigDir.Identity)\**\*.*">
|
||||
<DestDir>$([System.IO.Path]::GetDirectoryName('%(_TemplateConfigDir.Identity)'))\.template.config\</DestDir>
|
||||
</_TemplateConfigFileToCopy>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target
|
||||
Name="TransformTemplateConfigs"
|
||||
BeforeTargets="CoreBuild"
|
||||
DependsOnTargets="SetTemplateJsonSymbolReplacements"
|
||||
Inputs="@(_TemplateConfigFileToCopy)"
|
||||
Outputs="@(_TemplateConfigFileToCopy->'%(DestDir)%(FileName)%(Extension)')">
|
||||
|
||||
<!--
|
||||
For each template, copy its '.template.config.src' directory to '.template.config',
|
||||
removing any earlier output at that location
|
||||
-->
|
||||
<RemoveDir Directories="%(_TemplateConfigFileToCopy.DestDir)" />
|
||||
<Copy SourceFiles="%(_TemplateConfigFileToCopy.Identity)" DestinationFolder="%(_TemplateConfigFileToCopy.DestDir)" />
|
||||
|
||||
|
|
@ -49,8 +61,4 @@
|
|||
<Output TaskParameter="OutputPath" ItemName="Content" />
|
||||
</GenerateFileFromTemplate>
|
||||
</Target>
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
||||
<!-- Override SDK targets. This project does not produce a .dll. -->
|
||||
<Target Name="CoreCompile" />
|
||||
<Target Name="GetTargetPath" />
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<Router AppAssembly="typeof(Program).Assembly">
|
||||
<NotFoundContent>
|
||||
<NotFound>
|
||||
<p>Sorry, there's nothing at this address.</p>
|
||||
</NotFoundContent>
|
||||
</NotFound>
|
||||
</Router>
|
||||
|
|
|
|||
|
|
@ -208,8 +208,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
..\..\.editorconfig = ..\..\.editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Components.Prerendering", "..\Mvc\Mvc.Components.Prerendering\src\Microsoft.AspNetCore.Mvc.Components.Prerendering.csproj", "{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SignalR.Protocols.Json", "..\SignalR\common\Protocols.Json\src\Microsoft.AspNetCore.SignalR.Protocols.Json.csproj", "{ED210157-461B-45BB-9D86-B81A62792C30}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SignalR.Client", "..\SignalR\clients\csharp\Client\src\Microsoft.AspNetCore.SignalR.Client.csproj", "{DA137BD4-F7F1-4D53-855F-5EC40CEA36B0}"
|
||||
|
|
@ -1330,18 +1328,6 @@ Global
|
|||
{9088E4E4-B855-457F-AE9E-D86709A5E1F4}.Release|x64.Build.0 = Debug|Any CPU
|
||||
{9088E4E4-B855-457F-AE9E-D86709A5E1F4}.Release|x86.ActiveCfg = Debug|Any CPU
|
||||
{9088E4E4-B855-457F-AE9E-D86709A5E1F4}.Release|x86.Build.0 = Debug|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C}.Release|x86.Build.0 = Release|Any CPU
|
||||
{ED210157-461B-45BB-9D86-B81A62792C30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{ED210157-461B-45BB-9D86-B81A62792C30}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ED210157-461B-45BB-9D86-B81A62792C30}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
|
|
@ -1548,7 +1534,6 @@ Global
|
|||
{04262990-929C-42BF-85A9-21C25FA95617} = {2FC10057-7A0A-4E34-8302-879925BC0102}
|
||||
{DC47C40A-FC38-44E4-94A4-ADE794E76309} = {2FC10057-7A0A-4E34-8302-879925BC0102}
|
||||
{9088E4E4-B855-457F-AE9E-D86709A5E1F4} = {7260DED9-22A9-4E9D-92F4-5E8A4404DEAF}
|
||||
{3A4132B6-60DA-43A0-8E7B-4BF346F3247C} = {2FC10057-7A0A-4E34-8302-879925BC0102}
|
||||
{ED210157-461B-45BB-9D86-B81A62792C30} = {2FC10057-7A0A-4E34-8302-879925BC0102}
|
||||
{DA137BD4-F7F1-4D53-855F-5EC40CEA36B0} = {2FC10057-7A0A-4E34-8302-879925BC0102}
|
||||
{0CDAB70B-71DC-43BE-ACB7-AD2EE3541FFB} = {2FC10057-7A0A-4E34-8302-879925BC0102}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
public void Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { }
|
||||
public System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) { throw null; }
|
||||
}
|
||||
public partial class ChangeEventArgs : System.EventArgs
|
||||
{
|
||||
public ChangeEventArgs() { }
|
||||
public object Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public abstract partial class ComponentBase : Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleAfterRender, Microsoft.AspNetCore.Components.IHandleEvent
|
||||
{
|
||||
public ComponentBase() { }
|
||||
|
|
@ -188,35 +193,35 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
public static partial class EventCallbackFactoryBinderExtensions
|
||||
{
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<bool> setter, bool existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime> setter, System.DateTime existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime> setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<decimal> setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<double> setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<int> setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<long> setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<bool?> setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime?> setter, System.DateTime? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime?> setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<decimal?> setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<double?> setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<int?> setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<long?> setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<float?> setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<float> setter, float existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<string> setter, string existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> CreateBinder<T>(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<T> setter, T existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<bool> setter, bool existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset> setter, System.DateTimeOffset existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime> setter, System.DateTime existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime> setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<decimal> setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<double> setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<int> setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<long> setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<bool?> setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTimeOffset?> setter, System.DateTimeOffset? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime?> setter, System.DateTime? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.DateTime?> setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<decimal?> setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<double?> setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<int?> setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<long?> setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<float?> setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<float> setter, float existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<string> setter, string existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> CreateBinder<T>(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<T> setter, T existingValue, System.Globalization.CultureInfo culture = null) { throw null; }
|
||||
}
|
||||
public static partial class EventCallbackFactoryUIEventArgsExtensions
|
||||
public static partial class EventCallbackFactoryEventArgsExtensions
|
||||
{
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<Microsoft.AspNetCore.Components.UIChangeEventArgs> callback) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<Microsoft.AspNetCore.Components.UIEventArgs> callback) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIChangeEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func<Microsoft.AspNetCore.Components.UIChangeEventArgs, System.Threading.Tasks.Task> callback) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.UIEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func<Microsoft.AspNetCore.Components.UIEventArgs, System.Threading.Tasks.Task> callback) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<Microsoft.AspNetCore.Components.ChangeEventArgs> callback) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<System.EventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action<System.EventArgs> callback) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func<Microsoft.AspNetCore.Components.ChangeEventArgs, System.Threading.Tasks.Task> callback) { throw null; }
|
||||
public static Microsoft.AspNetCore.Components.EventCallback<System.EventArgs> Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func<System.EventArgs, System.Threading.Tasks.Task> callback) { throw null; }
|
||||
}
|
||||
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
||||
public readonly partial struct EventCallbackWorkItem
|
||||
|
|
@ -261,16 +266,6 @@ namespace Microsoft.AspNetCore.Components
|
|||
{
|
||||
public InjectAttribute() { }
|
||||
}
|
||||
public partial interface IUriHelper
|
||||
{
|
||||
event System.EventHandler<Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs> OnLocationChanged;
|
||||
string GetAbsoluteUri();
|
||||
string GetBaseUri();
|
||||
void NavigateTo(string uri);
|
||||
void NavigateTo(string uri, bool forceLoad);
|
||||
System.Uri ToAbsoluteUri(string href);
|
||||
string ToBaseRelativePath(string baseUri, string locationAbsolute);
|
||||
}
|
||||
[System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
|
||||
public sealed partial class LayoutAttribute : System.Attribute
|
||||
{
|
||||
|
|
@ -283,6 +278,10 @@ namespace Microsoft.AspNetCore.Components
|
|||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public Microsoft.AspNetCore.Components.RenderFragment Body { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public sealed partial class LocationChangeException : System.Exception
|
||||
{
|
||||
public LocationChangeException(string message, System.Exception innerException) { }
|
||||
}
|
||||
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
||||
public readonly partial struct MarkupString
|
||||
{
|
||||
|
|
@ -297,13 +296,40 @@ namespace Microsoft.AspNetCore.Components
|
|||
public NavigationException(string uri) { }
|
||||
public string Location { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
}
|
||||
public abstract partial class NavigationManager
|
||||
{
|
||||
protected NavigationManager() { }
|
||||
public string BaseUri { get { throw null; } protected set { } }
|
||||
public string Uri { get { throw null; } protected set { } }
|
||||
public event System.EventHandler<Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs> LocationChanged { add { } remove { } }
|
||||
protected virtual void EnsureInitialized() { }
|
||||
protected void Initialize(string baseUri, string uri) { }
|
||||
public void NavigateTo(string uri, bool forceLoad = false) { }
|
||||
protected abstract void NavigateToCore(string uri, bool forceLoad);
|
||||
protected void NotifyLocationChanged(bool isInterceptedLink) { }
|
||||
public System.Uri ToAbsoluteUri(string relativeUri) { throw null; }
|
||||
public string ToBaseRelativePath(string uri) { throw null; }
|
||||
}
|
||||
public abstract partial class OwningComponentBase : Microsoft.AspNetCore.Components.ComponentBase, System.IDisposable
|
||||
{
|
||||
protected OwningComponentBase() { }
|
||||
protected bool IsDisposed { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
protected System.IServiceProvider ScopedServices { get { throw null; } }
|
||||
protected virtual void Dispose(bool disposing) { }
|
||||
void System.IDisposable.Dispose() { }
|
||||
}
|
||||
public abstract partial class OwningComponentBase<TService> : Microsoft.AspNetCore.Components.OwningComponentBase, System.IDisposable
|
||||
{
|
||||
protected OwningComponentBase() { }
|
||||
protected TService Service { get { 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; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.RenderFragment Authorizing { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> NotAuthorizedContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> NotAuthorized { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public System.Type Page { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
|
|
@ -365,33 +391,6 @@ namespace Microsoft.AspNetCore.Components
|
|||
public RouteAttribute(string template) { }
|
||||
public string Template { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
}
|
||||
public partial class UIChangeEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
{
|
||||
public UIChangeEventArgs() { }
|
||||
public object Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIEventArgs
|
||||
{
|
||||
public UIEventArgs() { }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public abstract partial class UriHelperBase : Microsoft.AspNetCore.Components.IUriHelper
|
||||
{
|
||||
protected UriHelperBase() { }
|
||||
public event System.EventHandler<Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs> OnLocationChanged { add { } remove { } }
|
||||
protected virtual void EnsureInitialized() { }
|
||||
public string GetAbsoluteUri() { throw null; }
|
||||
public virtual string GetBaseUri() { throw null; }
|
||||
public virtual void InitializeState(string uriAbsolute, string baseUriAbsolute) { }
|
||||
public void NavigateTo(string uri) { }
|
||||
public void NavigateTo(string uri, bool forceLoad) { }
|
||||
protected abstract void NavigateToCore(string uri, bool forceLoad);
|
||||
protected void SetAbsoluteBaseUri(string baseUri) { }
|
||||
protected void SetAbsoluteUri(string uri) { }
|
||||
public System.Uri ToAbsoluteUri(string href) { throw null; }
|
||||
public string ToBaseRelativePath(string baseUri, string locationAbsolute) { throw null; }
|
||||
protected void TriggerOnLocationChanged(bool isinterceptedLink) { }
|
||||
}
|
||||
}
|
||||
namespace Microsoft.AspNetCore.Components.CompilerServices
|
||||
{
|
||||
|
|
@ -419,8 +418,10 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
public Microsoft.AspNetCore.Components.Forms.FieldIdentifier Field(string fieldName) { throw null; }
|
||||
public System.Collections.Generic.IEnumerable<string> GetValidationMessages() { throw null; }
|
||||
public System.Collections.Generic.IEnumerable<string> GetValidationMessages(Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; }
|
||||
public System.Collections.Generic.IEnumerable<string> GetValidationMessages(System.Linq.Expressions.Expression<System.Func<object>> accessor) { throw null; }
|
||||
public bool IsModified() { throw null; }
|
||||
public bool IsModified(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; }
|
||||
public bool IsModified(System.Linq.Expressions.Expression<System.Func<object>> accessor) { throw null; }
|
||||
public void MarkAsUnmodified() { }
|
||||
public void MarkAsUnmodified(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { }
|
||||
public void NotifyFieldChanged(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { }
|
||||
|
|
@ -431,24 +432,20 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
{
|
||||
public static Microsoft.AspNetCore.Components.Forms.EditContext AddDataAnnotationsValidation(this Microsoft.AspNetCore.Components.Forms.EditContext editContext) { throw null; }
|
||||
}
|
||||
public static partial class EditContextExpressionExtensions
|
||||
public sealed partial class FieldChangedEventArgs : System.EventArgs
|
||||
{
|
||||
public static System.Collections.Generic.IEnumerable<string> GetValidationMessages(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression<System.Func<object>> accessor) { throw null; }
|
||||
public static bool IsModified(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression<System.Func<object>> accessor) { throw null; }
|
||||
}
|
||||
public sealed partial class FieldChangedEventArgs
|
||||
{
|
||||
internal FieldChangedEventArgs() { }
|
||||
public FieldChangedEventArgs(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { }
|
||||
public Microsoft.AspNetCore.Components.Forms.FieldIdentifier FieldIdentifier { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
}
|
||||
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
||||
public readonly partial struct FieldIdentifier
|
||||
public readonly partial struct FieldIdentifier : System.IEquatable<Microsoft.AspNetCore.Components.Forms.FieldIdentifier>
|
||||
{
|
||||
private readonly object _dummy;
|
||||
public FieldIdentifier(object model, string fieldName) { throw null; }
|
||||
public string FieldName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public object Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public static Microsoft.AspNetCore.Components.Forms.FieldIdentifier Create<T>(System.Linq.Expressions.Expression<System.Func<T>> accessor) { throw null; }
|
||||
public bool Equals(Microsoft.AspNetCore.Components.Forms.FieldIdentifier otherIdentifier) { throw null; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
}
|
||||
|
|
@ -457,24 +454,23 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
public ValidationMessageStore(Microsoft.AspNetCore.Components.Forms.EditContext editContext) { }
|
||||
public System.Collections.Generic.IEnumerable<string> this[Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier] { get { throw null; } }
|
||||
public System.Collections.Generic.IEnumerable<string> this[System.Linq.Expressions.Expression<System.Func<object>> accessor] { get { throw null; } }
|
||||
public void Add(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier, System.Collections.Generic.IEnumerable<string> messages) { }
|
||||
public void Add(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier, string message) { }
|
||||
public void AddRange(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier, System.Collections.Generic.IEnumerable<string> messages) { }
|
||||
public void Add(System.Linq.Expressions.Expression<System.Func<object>> accessor, System.Collections.Generic.IEnumerable<string> messages) { }
|
||||
public void Add(System.Linq.Expressions.Expression<System.Func<object>> accessor, string message) { }
|
||||
public void Clear() { }
|
||||
public void Clear(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { }
|
||||
public void Clear(System.Linq.Expressions.Expression<System.Func<object>> accessor) { }
|
||||
}
|
||||
public static partial class ValidationMessageStoreExpressionExtensions
|
||||
public sealed partial class ValidationRequestedEventArgs : System.EventArgs
|
||||
{
|
||||
public static void Add(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression<System.Func<object>> accessor, string message) { }
|
||||
public static void AddRange(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression<System.Func<object>> accessor, System.Collections.Generic.IEnumerable<string> messages) { }
|
||||
public static void Clear(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression<System.Func<object>> accessor) { }
|
||||
public static readonly new Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs Empty;
|
||||
public ValidationRequestedEventArgs() { }
|
||||
}
|
||||
public sealed partial class ValidationRequestedEventArgs
|
||||
public sealed partial class ValidationStateChangedEventArgs : System.EventArgs
|
||||
{
|
||||
internal ValidationRequestedEventArgs() { }
|
||||
}
|
||||
public sealed partial class ValidationStateChangedEventArgs
|
||||
{
|
||||
internal ValidationStateChangedEventArgs() { }
|
||||
public static readonly new Microsoft.AspNetCore.Components.Forms.ValidationStateChangedEventArgs Empty;
|
||||
public ValidationStateChangedEventArgs() { }
|
||||
}
|
||||
}
|
||||
namespace Microsoft.AspNetCore.Components.Rendering
|
||||
|
|
@ -519,7 +515,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
public event System.UnhandledExceptionEventHandler UnhandledSynchronizationException { add { } remove { } }
|
||||
protected internal virtual void AddToRenderQueue(int componentId, Microsoft.AspNetCore.Components.RenderFragment renderFragment) { }
|
||||
protected internal int AssignRootComponentId(Microsoft.AspNetCore.Components.IComponent component) { throw null; }
|
||||
public virtual System.Threading.Tasks.Task DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.Rendering.EventFieldInfo fieldInfo, Microsoft.AspNetCore.Components.UIEventArgs eventArgs) { throw null; }
|
||||
public virtual System.Threading.Tasks.Task DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.Rendering.EventFieldInfo fieldInfo, System.EventArgs eventArgs) { throw null; }
|
||||
public void Dispose() { }
|
||||
protected virtual void Dispose(bool disposing) { }
|
||||
protected abstract void HandleException(System.Exception exception);
|
||||
|
|
@ -632,16 +628,17 @@ namespace Microsoft.AspNetCore.Components.RenderTree
|
|||
}
|
||||
namespace Microsoft.AspNetCore.Components.Routing
|
||||
{
|
||||
public partial interface IHostEnvironmentNavigationManager
|
||||
{
|
||||
void Initialize(string baseUri, string uri);
|
||||
}
|
||||
public partial interface INavigationInterception
|
||||
{
|
||||
System.Threading.Tasks.Task EnableNavigationInterceptionAsync();
|
||||
}
|
||||
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
||||
public readonly partial struct LocationChangedEventArgs
|
||||
public partial class LocationChangedEventArgs : System.EventArgs
|
||||
{
|
||||
private readonly object _dummy;
|
||||
private readonly int _dummyPrimitive;
|
||||
public LocationChangedEventArgs(string location, bool isNavigationIntercepted) { throw null; }
|
||||
public LocationChangedEventArgs(string location, bool isNavigationIntercepted) { }
|
||||
public bool IsNavigationIntercepted { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public string Location { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
}
|
||||
|
|
@ -651,11 +648,11 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public System.Reflection.Assembly AppAssembly { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public Microsoft.AspNetCore.Components.RenderFragment AuthorizingContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.RenderFragment Authorizing { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> NotAuthorizedContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.AuthenticationState> NotAuthorized { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public Microsoft.AspNetCore.Components.RenderFragment NotFoundContent { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.RenderFragment NotFound { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public void Attach(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { }
|
||||
public void Dispose() { }
|
||||
System.Threading.Tasks.Task Microsoft.AspNetCore.Components.IHandleAfterRender.OnAfterRenderAsync() { throw null; }
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
else if (isAuthorized)
|
||||
{
|
||||
var authorizedContent = Authorized ?? ChildContent;
|
||||
builder.AddContent(1, authorizedContent?.Invoke(currentAuthenticationState));
|
||||
var authorized = Authorized ?? ChildContent;
|
||||
builder.AddContent(1, authorized?.Invoke(currentAuthenticationState));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Supplies information about an event that is being raised.
|
||||
/// Supplies information about an change event that is being raised.
|
||||
/// </summary>
|
||||
public class UIEventArgs
|
||||
public class ChangeEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the event.
|
||||
/// Gets or sets the new value.
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<string> setter,
|
||||
|
|
@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<bool> setter,
|
||||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<bool?> setter,
|
||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<int> setter,
|
||||
|
|
@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<int?> setter,
|
||||
|
|
@ -126,7 +126,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<long> setter,
|
||||
|
|
@ -145,7 +145,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<long?> setter,
|
||||
|
|
@ -164,7 +164,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<float> setter,
|
||||
|
|
@ -183,7 +183,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<float?> setter,
|
||||
|
|
@ -202,7 +202,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<double> setter,
|
||||
|
|
@ -221,7 +221,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<double?> setter,
|
||||
|
|
@ -240,7 +240,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<decimal> setter,
|
||||
|
|
@ -259,7 +259,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<decimal?> setter,
|
||||
|
|
@ -278,7 +278,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTime> setter,
|
||||
|
|
@ -298,7 +298,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="format"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTime> setter,
|
||||
|
|
@ -318,7 +318,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTime?> setter,
|
||||
|
|
@ -338,7 +338,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="format"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTime?> setter,
|
||||
|
|
@ -358,7 +358,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTimeOffset> setter,
|
||||
|
|
@ -378,7 +378,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="format"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTimeOffset> setter,
|
||||
|
|
@ -398,7 +398,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTimeOffset?> setter,
|
||||
|
|
@ -418,7 +418,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="format"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<DateTimeOffset?> setter,
|
||||
|
|
@ -439,7 +439,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="existingValue"></param>
|
||||
/// <param name="culture"></param>
|
||||
/// <returns></returns>
|
||||
public static EventCallback<UIChangeEventArgs> CreateBinder<T>(
|
||||
public static EventCallback<ChangeEventArgs> CreateBinder<T>(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<T> setter,
|
||||
|
|
@ -449,14 +449,14 @@ namespace Microsoft.AspNetCore.Components
|
|||
return CreateBinderCore<T>(factory, receiver, setter, culture, ParserDelegateCache.Get<T>());
|
||||
}
|
||||
|
||||
private static EventCallback<UIChangeEventArgs> CreateBinderCore<T>(
|
||||
private static EventCallback<ChangeEventArgs> CreateBinderCore<T>(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<T> setter,
|
||||
CultureInfo culture,
|
||||
BindConverter.BindParser<T> converter)
|
||||
{
|
||||
Action<UIChangeEventArgs> callback = e =>
|
||||
Action<ChangeEventArgs> callback = e =>
|
||||
{
|
||||
T value = default;
|
||||
var converted = false;
|
||||
|
|
@ -489,10 +489,10 @@ namespace Microsoft.AspNetCore.Components
|
|||
setter(default);
|
||||
}
|
||||
};
|
||||
return factory.Create<UIChangeEventArgs>(receiver, callback);
|
||||
return factory.Create<ChangeEventArgs>(receiver, callback);
|
||||
}
|
||||
|
||||
private static EventCallback<UIChangeEventArgs> CreateBinderCore<T>(
|
||||
private static EventCallback<ChangeEventArgs> CreateBinderCore<T>(
|
||||
this EventCallbackFactory factory,
|
||||
object receiver,
|
||||
Action<T> setter,
|
||||
|
|
@ -500,7 +500,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
string format,
|
||||
BindConverter.BindParserWithFormat<T> converter)
|
||||
{
|
||||
Action<UIChangeEventArgs> callback = e =>
|
||||
Action<ChangeEventArgs> callback = e =>
|
||||
{
|
||||
T value = default;
|
||||
var converted = false;
|
||||
|
|
@ -533,7 +533,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
setter(default);
|
||||
}
|
||||
};
|
||||
return factory.Create<UIChangeEventArgs>(receiver, callback);
|
||||
return factory.Create<ChangeEventArgs>(receiver, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ using System.Threading.Tasks;
|
|||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extension methods for <see cref="EventCallbackFactory"/> and <see cref="UIEventArgs"/> types.
|
||||
/// Provides extension methods for <see cref="EventCallbackFactory"/> and <see cref="EventArgs"/> types.
|
||||
/// </summary>
|
||||
public static class EventCallbackFactoryUIEventArgsExtensions
|
||||
public static class EventCallbackFactoryEventArgsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates an <see cref="EventCallback"/> for the provided <paramref name="receiver"/> and
|
||||
|
|
@ -19,14 +19,14 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="receiver">The event receiver.</param>
|
||||
/// <param name="callback">The event callback.</param>
|
||||
/// <returns>The <see cref="EventCallback"/>.</returns>
|
||||
public static EventCallback<UIEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<UIEventArgs> callback)
|
||||
public static EventCallback<EventArgs> Create(this EventCallbackFactory factory, object receiver, Action<EventArgs> callback)
|
||||
{
|
||||
if (factory == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(factory));
|
||||
}
|
||||
|
||||
return factory.Create<UIEventArgs>(receiver, callback);
|
||||
return factory.Create<EventArgs>(receiver, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -37,14 +37,14 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="receiver">The event receiver.</param>
|
||||
/// <param name="callback">The event callback.</param>
|
||||
/// <returns>The <see cref="EventCallback"/>.</returns>
|
||||
public static EventCallback<UIEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<UIEventArgs, Task> callback)
|
||||
public static EventCallback<EventArgs> Create(this EventCallbackFactory factory, object receiver, Func<EventArgs, Task> callback)
|
||||
{
|
||||
if (factory == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(factory));
|
||||
}
|
||||
|
||||
return factory.Create<UIEventArgs>(receiver, callback);
|
||||
return factory.Create<EventArgs>(receiver, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -55,14 +55,14 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="receiver">The event receiver.</param>
|
||||
/// <param name="callback">The event callback.</param>
|
||||
/// <returns>The <see cref="EventCallback"/>.</returns>
|
||||
public static EventCallback<UIChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<UIChangeEventArgs> callback)
|
||||
public static EventCallback<ChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Action<ChangeEventArgs> callback)
|
||||
{
|
||||
if (factory == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(factory));
|
||||
}
|
||||
|
||||
return factory.Create<UIChangeEventArgs>(receiver, callback);
|
||||
return factory.Create<ChangeEventArgs>(receiver, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -73,14 +73,14 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// <param name="receiver">The event receiver.</param>
|
||||
/// <param name="callback">The event callback.</param>
|
||||
/// <returns>The <see cref="EventCallback"/>.</returns>
|
||||
public static EventCallback<UIChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<UIChangeEventArgs, Task> callback)
|
||||
public static EventCallback<ChangeEventArgs> Create(this EventCallbackFactory factory, object receiver, Func<ChangeEventArgs, Task> callback)
|
||||
{
|
||||
if (factory == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(factory));
|
||||
}
|
||||
|
||||
return factory.Create<UIChangeEventArgs>(receiver, callback);
|
||||
return factory.Create<ChangeEventArgs>(receiver, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Forms
|
||||
{
|
||||
|
|
@ -158,6 +159,16 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current validation messages for the specified field.
|
||||
///
|
||||
/// This method does not perform validation itself. It only returns messages determined by previous validation actions.
|
||||
/// </summary>
|
||||
/// <param name="accessor">Identifies the field whose current validation messages should be returned.</param>
|
||||
/// <returns>The current validation messages for the specified field.</returns>
|
||||
public IEnumerable<string> GetValidationMessages(Expression<Func<object>> accessor)
|
||||
=> GetValidationMessages(FieldIdentifier.Create(accessor));
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified fields in this <see cref="EditContext"/> has been modified.
|
||||
/// </summary>
|
||||
|
|
@ -167,6 +178,14 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
? state.IsModified
|
||||
: false;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified fields in this <see cref="EditContext"/> has been modified.
|
||||
/// </summary>
|
||||
/// <param name="accessor">Identifies the field whose current validation messages should be returned.</param>
|
||||
/// <returns>True if the field has been modified; otherwise false.</returns>
|
||||
public bool IsModified(Expression<Func<object>> accessor)
|
||||
=> IsModified(FieldIdentifier.Create(accessor));
|
||||
|
||||
/// <summary>
|
||||
/// Validates this <see cref="EditContext"/>.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
|
||||
Validator.TryValidateProperty(propertyValue, validationContext, results);
|
||||
messages.Clear(fieldIdentifier);
|
||||
messages.AddRange(fieldIdentifier, results.Select(result => result.ErrorMessage));
|
||||
messages.Add(fieldIdentifier, results.Select(result => result.ErrorMessage));
|
||||
|
||||
// We have to notify even if there were no messages before and are still no messages now,
|
||||
// because the "state" that changed might be the completion of some async validation task
|
||||
|
|
|
|||
|
|
@ -1,35 +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;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Forms
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extension methods to simplify using <see cref="EditContext"/> with expressions.
|
||||
/// </summary>
|
||||
public static class EditContextExpressionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the current validation messages for the specified field.
|
||||
///
|
||||
/// This method does not perform validation itself. It only returns messages determined by previous validation actions.
|
||||
/// </summary>
|
||||
/// <param name="editContext">The <see cref="EditContext"/>.</param>
|
||||
/// <param name="accessor">Identifies the field whose current validation messages should be returned.</param>
|
||||
/// <returns>The current validation messages for the specified field.</returns>
|
||||
public static IEnumerable<string> GetValidationMessages(this EditContext editContext, Expression<Func<object>> accessor)
|
||||
=> editContext.GetValidationMessages(FieldIdentifier.Create(accessor));
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified fields in this <see cref="EditContext"/> has been modified.
|
||||
/// </summary>
|
||||
/// <param name="editContext">The <see cref="EditContext"/>.</param>
|
||||
/// <param name="accessor">Identifies the field whose current validation messages should be returned.</param>
|
||||
/// <returns>True if the field has been modified; otherwise false.</returns>
|
||||
public static bool IsModified(this EditContext editContext, Expression<Func<object>> accessor)
|
||||
=> editContext.IsModified(FieldIdentifier.Create(accessor));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +1,27 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Forms
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides information about the <see cref="EditContext.OnFieldChanged"/> event.
|
||||
/// </summary>
|
||||
public sealed class FieldChangedEventArgs
|
||||
public sealed class FieldChangedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="FieldChangedEventArgs"/>.
|
||||
/// </summary>
|
||||
/// <param name="fieldIdentifier">The <see cref="Forms.FieldIdentifier"/></param>
|
||||
public FieldChangedEventArgs(in FieldIdentifier fieldIdentifier)
|
||||
{
|
||||
FieldIdentifier = fieldIdentifier;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the field whose value has changed.
|
||||
/// </summary>
|
||||
public FieldIdentifier FieldIdentifier { get; }
|
||||
|
||||
internal FieldChangedEventArgs(in FieldIdentifier fieldIdentifier)
|
||||
{
|
||||
FieldIdentifier = fieldIdentifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// Uniquely identifies a single field that can be edited. This may correspond to a property on a
|
||||
/// model object, or can be any other named value.
|
||||
/// </summary>
|
||||
public readonly struct FieldIdentifier
|
||||
public readonly struct FieldIdentifier : IEquatable<FieldIdentifier>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FieldIdentifier"/> structure.
|
||||
|
|
@ -68,8 +68,15 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
=> obj is FieldIdentifier otherIdentifier
|
||||
&& otherIdentifier.Model == Model
|
||||
&& string.Equals(otherIdentifier.FieldName, FieldName, StringComparison.Ordinal);
|
||||
&& Equals(otherIdentifier);
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(FieldIdentifier otherIdentifier)
|
||||
{
|
||||
return
|
||||
otherIdentifier.Model == Model &&
|
||||
string.Equals(otherIdentifier.FieldName, FieldName, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private static void ParseAccessor<T>(Expression<Func<T>> accessor, out object model, out string fieldName)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,14 +33,30 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
public void Add(in FieldIdentifier fieldIdentifier, string message)
|
||||
=> GetOrCreateMessagesListForField(fieldIdentifier).Add(message);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a validation message for the specified field.
|
||||
/// </summary>
|
||||
/// <param name="accessor">Identifies the field for which to add the message.</param>
|
||||
/// <param name="message">The validation message.</param>
|
||||
public void Add(Expression<Func<object>> accessor, string message)
|
||||
=> Add(FieldIdentifier.Create(accessor), message);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the messages from the specified collection for the specified field.
|
||||
/// </summary>
|
||||
/// <param name="fieldIdentifier">The identifier for the field.</param>
|
||||
/// <param name="messages">The validation messages to be added.</param>
|
||||
public void AddRange(in FieldIdentifier fieldIdentifier, IEnumerable<string> messages)
|
||||
public void Add(in FieldIdentifier fieldIdentifier, IEnumerable<string> messages)
|
||||
=> GetOrCreateMessagesListForField(fieldIdentifier).AddRange(messages);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the messages from the specified collection for the specified field.
|
||||
/// </summary>
|
||||
/// <param name="accessor">Identifies the field for which to add the messages.</param>
|
||||
/// <param name="messages">The validation messages to be added.</param>
|
||||
public void Add(Expression<Func<object>> accessor, IEnumerable<string> messages)
|
||||
=> Add(FieldIdentifier.Create(accessor), messages);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the validation messages within this <see cref="ValidationMessageStore"/> for the specified field.
|
||||
///
|
||||
|
|
@ -74,6 +90,13 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
_messages.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all messages within this <see cref="ValidationMessageStore"/> for the specified field.
|
||||
/// </summary>
|
||||
/// <param name="accessor">Identifies the field for which to remove the messages.</param>
|
||||
public void Clear(Expression<Func<object>> accessor)
|
||||
=> Clear(FieldIdentifier.Create(accessor));
|
||||
|
||||
/// <summary>
|
||||
/// Removes all messages within this <see cref="ValidationMessageStore"/> for the specified field.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,41 +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;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Forms
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extension methods to simplify using <see cref="ValidationMessageStore"/> with expressions.
|
||||
/// </summary>
|
||||
public static class ValidationMessageStoreExpressionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a validation message for the specified field.
|
||||
/// </summary>
|
||||
/// <param name="store">The <see cref="ValidationMessageStore"/>.</param>
|
||||
/// <param name="accessor">Identifies the field for which to add the message.</param>
|
||||
/// <param name="message">The validation message.</param>
|
||||
public static void Add(this ValidationMessageStore store, Expression<Func<object>> accessor, string message)
|
||||
=> store.Add(FieldIdentifier.Create(accessor), message);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the messages from the specified collection for the specified field.
|
||||
/// </summary>
|
||||
/// <param name="store">The <see cref="ValidationMessageStore"/>.</param>
|
||||
/// <param name="accessor">Identifies the field for which to add the messages.</param>
|
||||
/// <param name="messages">The validation messages to be added.</param>
|
||||
public static void AddRange(this ValidationMessageStore store, Expression<Func<object>> accessor, IEnumerable<string> messages)
|
||||
=> store.AddRange(FieldIdentifier.Create(accessor), messages);
|
||||
|
||||
/// <summary>
|
||||
/// Removes all messages within this <see cref="ValidationMessageStore"/> for the specified field.
|
||||
/// </summary>
|
||||
/// <param name="store">The <see cref="ValidationMessageStore"/>.</param>
|
||||
/// <param name="accessor">Identifies the field for which to remove the messages.</param>
|
||||
public static void Clear(this ValidationMessageStore store, Expression<Func<object>> accessor)
|
||||
=> store.Clear(FieldIdentifier.Create(accessor));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,24 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Forms
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides information about the <see cref="EditContext.OnValidationRequested"/> event.
|
||||
/// </summary>
|
||||
public sealed class ValidationRequestedEventArgs
|
||||
public sealed class ValidationRequestedEventArgs : EventArgs
|
||||
{
|
||||
internal static readonly ValidationRequestedEventArgs Empty = new ValidationRequestedEventArgs();
|
||||
/// <summary>
|
||||
/// Gets a shared empty instance of <see cref="ValidationRequestedEventArgs"/>.
|
||||
/// </summary>
|
||||
public static new readonly ValidationRequestedEventArgs Empty = new ValidationRequestedEventArgs();
|
||||
|
||||
internal ValidationRequestedEventArgs()
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="ValidationRequestedEventArgs"/>.
|
||||
/// </summary>
|
||||
public ValidationRequestedEventArgs()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,24 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Forms
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides information about the <see cref="EditContext.OnValidationStateChanged"/> event.
|
||||
/// </summary>
|
||||
public sealed class ValidationStateChangedEventArgs
|
||||
public sealed class ValidationStateChangedEventArgs : EventArgs
|
||||
{
|
||||
internal static readonly ValidationStateChangedEventArgs Empty = new ValidationStateChangedEventArgs();
|
||||
/// <summary>
|
||||
/// Gets a shared empty instance of <see cref="ValidationStateChangedEventArgs"/>.
|
||||
/// </summary>
|
||||
public new static readonly ValidationStateChangedEventArgs Empty = new ValidationStateChangedEventArgs();
|
||||
|
||||
internal ValidationStateChangedEventArgs()
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="ValidationStateChangedEventArgs" />
|
||||
/// </summary>
|
||||
public ValidationStateChangedEventArgs()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,64 +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;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Helpers for working with URIs and navigation state.
|
||||
/// </summary>
|
||||
public interface IUriHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the current absolute URI.
|
||||
/// </summary>
|
||||
/// <returns>The current absolute URI.</returns>
|
||||
string GetAbsoluteUri();
|
||||
|
||||
/// <summary>
|
||||
/// An event that fires when the navigation location has changed.
|
||||
/// </summary>
|
||||
event EventHandler<LocationChangedEventArgs> OnLocationChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Converts a relative URI into an absolute one (by resolving it
|
||||
/// relative to the current absolute URI).
|
||||
/// </summary>
|
||||
/// <param name="href">The relative URI.</param>
|
||||
/// <returns>The absolute URI.</returns>
|
||||
Uri ToAbsoluteUri(string href);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base URI (with trailing slash) that can be prepended before relative URI paths to produce an absolute URI.
|
||||
/// Typically this corresponds to the 'href' attribute on the document's <base> element.
|
||||
/// </summary>
|
||||
/// <returns>The URI prefix, which has a trailing slash.</returns>
|
||||
string GetBaseUri();
|
||||
|
||||
/// <summary>
|
||||
/// Given a base URI (e.g., one previously returned by <see cref="GetBaseUri"/>),
|
||||
/// converts an absolute URI into one relative to the base URI prefix.
|
||||
/// </summary>
|
||||
/// <param name="baseUri">The base URI prefix (e.g., previously returned by <see cref="GetBaseUri"/>).</param>
|
||||
/// <param name="locationAbsolute">An absolute URI that is within the space of the base URI.</param>
|
||||
/// <returns>A relative URI path.</returns>
|
||||
string ToBaseRelativePath(string baseUri, string locationAbsolute);
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The destination URI. This can be absolute, or relative to the base URI
|
||||
/// (as returned by <see cref="GetBaseUri"/>).</param>
|
||||
void NavigateTo(string uri);
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The destination URI. This can be absolute, or relative to the base URI
|
||||
/// (as returned by <see cref="GetBaseUri"/>).</param>
|
||||
/// <param name="forceLoad">If true, bypasses client-side routing and forces the browser to load the new page from the server, whether or not the URI would normally be handled by the client-side router.</param>
|
||||
void NavigateTo(string uri, bool forceLoad);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// An exception thrown when <see cref="NavigationManager.LocationChanged"/> throws an exception.
|
||||
/// </summary>
|
||||
public sealed class LocationChangeException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="LocationChangeException"/>.
|
||||
/// </summary>
|
||||
/// <param name="message">The exception message.</param>
|
||||
/// <param name="innerException">The inner exception.</param>
|
||||
public LocationChangeException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ using System;
|
|||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception thrown when an <see cref="IUriHelper"/> is not able to navigate to a different url.
|
||||
/// Exception thrown when an <see cref="NavigationManager"/> is not able to navigate to a different url.
|
||||
/// </summary>
|
||||
public class NavigationException : Exception
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,269 @@
|
|||
// 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 Microsoft.AspNetCore.Components.Routing;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides an abstraction for querying and mananging URI navigation.
|
||||
/// </summary>
|
||||
public abstract class NavigationManager
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that fires when the navigation location has changed.
|
||||
/// </summary>
|
||||
public event EventHandler<LocationChangedEventArgs> LocationChanged
|
||||
{
|
||||
add
|
||||
{
|
||||
AssertInitialized();
|
||||
_locationChanged += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
AssertInitialized();
|
||||
_locationChanged -= value;
|
||||
}
|
||||
}
|
||||
|
||||
private EventHandler<LocationChangedEventArgs> _locationChanged;
|
||||
|
||||
// For the baseUri it's worth storing as a System.Uri so we can do operations
|
||||
// on that type. System.Uri gives us access to the original string anyway.
|
||||
private Uri _baseUri;
|
||||
|
||||
// The URI. Always represented an absolute URI.
|
||||
private string _uri;
|
||||
|
||||
private bool _isInitialized;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current base URI. The <see cref="BaseUri" /> is always represented as an absolute URI in string form with trailing slash.
|
||||
/// Typically this corresponds to the 'href' attribute on the document's <base> element.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Setting <see cref="BaseUri" /> will not trigger the <see cref="LocationChanged" /> event.
|
||||
/// </remarks>
|
||||
public string BaseUri
|
||||
{
|
||||
get
|
||||
{
|
||||
AssertInitialized();
|
||||
return _baseUri.OriginalString;
|
||||
}
|
||||
protected set
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
value = NormalizeBaseUri(value);
|
||||
}
|
||||
|
||||
_baseUri = new Uri(value, UriKind.Absolute);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current URI. The <see cref="Uri" /> is always represented as an absolute URI in string form.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Setting <see cref="Uri" /> will not trigger the <see cref="LocationChanged" /> event.
|
||||
/// </remarks>
|
||||
public string Uri
|
||||
{
|
||||
get
|
||||
{
|
||||
AssertInitialized();
|
||||
return _uri;
|
||||
}
|
||||
protected set
|
||||
{
|
||||
Validate(_baseUri, value);
|
||||
_uri = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The destination URI. This can be absolute, or relative to the base URI
|
||||
/// (as returned by <see cref="BaseUri"/>).</param>
|
||||
/// <param name="forceLoad">If true, bypasses client-side routing and forces the browser to load the new page from the server, whether or not the URI would normally be handled by the client-side router.</param>
|
||||
public void NavigateTo(string uri, bool forceLoad = false)
|
||||
{
|
||||
AssertInitialized();
|
||||
NavigateToCore(uri, forceLoad);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The destination URI. This can be absolute, or relative to the base URI
|
||||
/// (as returned by <see cref="BaseUri"/>).</param>
|
||||
/// <param name="forceLoad">If true, bypasses client-side routing and forces the browser to load the new page from the server, whether or not the URI would normally be handled by the client-side router.</param>
|
||||
protected abstract void NavigateToCore(string uri, bool forceLoad);
|
||||
|
||||
/// <summary>
|
||||
/// Called to initialize BaseURI and current URI before these values are used for the first time.
|
||||
/// Override <see cref="EnsureInitialized" /> and call this method to dynamically calculate these values.
|
||||
/// </summary>
|
||||
protected void Initialize(string baseUri, string uri)
|
||||
{
|
||||
// Make sure it's possible/safe to call this method from constructors of derived classes.
|
||||
if (uri == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(uri));
|
||||
}
|
||||
|
||||
if (baseUri == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(baseUri));
|
||||
}
|
||||
|
||||
if (_isInitialized)
|
||||
{
|
||||
throw new InvalidOperationException($"'{GetType().Name}' already initialized.");
|
||||
}
|
||||
|
||||
_isInitialized = true;
|
||||
|
||||
// Setting BaseUri before Uri so they get validated.
|
||||
BaseUri = baseUri;
|
||||
Uri = uri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows derived classes to lazyly self-initialize. Implementations that support lazy-initialization should override
|
||||
/// this method and call <see cref="Initialize(string, string)" />.
|
||||
/// </summary>
|
||||
protected virtual void EnsureInitialized()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a relative URI into an absolute one (by resolving it
|
||||
/// relative to the current absolute URI).
|
||||
/// </summary>
|
||||
/// <param name="relativeUri">The relative URI.</param>
|
||||
/// <returns>The absolute URI.</returns>
|
||||
public Uri ToAbsoluteUri(string relativeUri)
|
||||
{
|
||||
AssertInitialized();
|
||||
return new Uri(_baseUri, relativeUri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a base URI (e.g., one previously returned by <see cref="BaseUri"/>),
|
||||
/// converts an absolute URI into one relative to the base URI prefix.
|
||||
/// </summary>
|
||||
/// <param name="uri">An absolute URI that is within the space of the base URI.</param>
|
||||
/// <returns>A relative URI path.</returns>
|
||||
public string ToBaseRelativePath(string uri)
|
||||
{
|
||||
if (uri.StartsWith(_baseUri.OriginalString, StringComparison.Ordinal))
|
||||
{
|
||||
// The absolute URI must be of the form "{baseUri}something" (where
|
||||
// baseUri ends with a slash), and from that we return "something"
|
||||
return uri.Substring(_baseUri.OriginalString.Length);
|
||||
}
|
||||
|
||||
var hashIndex = uri.IndexOf('#');
|
||||
var uriWithoutHash = hashIndex < 0 ? uri : uri.Substring(0, hashIndex);
|
||||
if ($"{uriWithoutHash}/".Equals(_baseUri.OriginalString, StringComparison.Ordinal))
|
||||
{
|
||||
// Special case: for the base URI "/something/", if you're at
|
||||
// "/something" then treat it as if you were at "/something/" (i.e.,
|
||||
// with the trailing slash). It's a bit ambiguous because we don't know
|
||||
// whether the server would return the same page whether or not the
|
||||
// slash is present, but ASP.NET Core at least does by default when
|
||||
// using PathBase.
|
||||
return uri.Substring(_baseUri.OriginalString.Length - 1);
|
||||
}
|
||||
|
||||
var message = $"The URI '{uri}' is not contained by the base URI '{_baseUri}'.";
|
||||
throw new ArgumentException(message);
|
||||
}
|
||||
|
||||
internal static string NormalizeBaseUri(string baseUri)
|
||||
{
|
||||
var lastSlashIndex = baseUri.LastIndexOf('/');
|
||||
if (lastSlashIndex >= 0)
|
||||
{
|
||||
baseUri = baseUri.Substring(0, lastSlashIndex + 1);
|
||||
}
|
||||
|
||||
return baseUri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Triggers the <see cref="LocationChanged"/> event with the current URI value.
|
||||
/// </summary>
|
||||
protected void NotifyLocationChanged(bool isInterceptedLink)
|
||||
{
|
||||
try
|
||||
{
|
||||
_locationChanged?.Invoke(this, new LocationChangedEventArgs(_uri, isInterceptedLink));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new LocationChangeException("An exception occurred while dispatching a location changed event.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void AssertInitialized()
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
EnsureInitialized();
|
||||
}
|
||||
|
||||
if (!_isInitialized)
|
||||
{
|
||||
throw new InvalidOperationException($"'{GetType().Name}' has not been initialized.");
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TryGetLengthOfBaseUriPrefix(Uri baseUri, string uri, out int length)
|
||||
{
|
||||
if (uri.StartsWith(baseUri.OriginalString, StringComparison.Ordinal))
|
||||
{
|
||||
// The absolute URI must be of the form "{baseUri}something" (where
|
||||
// baseUri ends with a slash), and from that we return "something"
|
||||
length = baseUri.OriginalString.Length;
|
||||
return true;
|
||||
}
|
||||
|
||||
var hashIndex = uri.IndexOf('#');
|
||||
var uriWithoutHash = hashIndex < 0 ? uri : uri.Substring(0, hashIndex);
|
||||
if ($"{uriWithoutHash}/".Equals(baseUri.OriginalString, StringComparison.Ordinal))
|
||||
{
|
||||
// Special case: for the base URI "/something/", if you're at
|
||||
// "/something" then treat it as if you were at "/something/" (i.e.,
|
||||
// with the trailing slash). It's a bit ambiguous because we don't know
|
||||
// whether the server would return the same page whether or not the
|
||||
// slash is present, but ASP.NET Core at least does by default when
|
||||
// using PathBase.
|
||||
length = baseUri.OriginalString.Length - 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
length = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void Validate(Uri baseUri, string uri)
|
||||
{
|
||||
if (baseUri == null || uri == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryGetLengthOfBaseUriPrefix(baseUri, uri, out _))
|
||||
{
|
||||
var message = $"The URI '{uri}' is not contained by the base URI '{baseUri}'.";
|
||||
throw new ArgumentException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
// 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 Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// A base class that creates a service provider scope.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Use the <see cref="OwningComponentBase"/> class as a base class to author components that control
|
||||
/// the lifetime of a service provider scope. This is useful when using a transient or scoped service that
|
||||
/// requires disposal such as a repository or database abstraction. Using <see cref="OwningComponentBase"/>
|
||||
/// as a base class ensures that the service provider scope is disposed with the component.
|
||||
/// </remarks>
|
||||
public abstract class OwningComponentBase : ComponentBase, IDisposable
|
||||
{
|
||||
private IServiceScope _scope;
|
||||
|
||||
[Inject] IServiceScopeFactory ScopeFactory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value determining if the component and associated services have been disposed.
|
||||
/// </summary>
|
||||
protected bool IsDisposed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scoped <see cref="IServiceProvider"/> that is associated with this component.
|
||||
/// </summary>
|
||||
protected IServiceProvider ScopedServices
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ScopeFactory == null)
|
||||
{
|
||||
throw new InvalidOperationException("Services cannot be accessed before the component is initialized.");
|
||||
}
|
||||
|
||||
if (IsDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(GetType().Name);
|
||||
}
|
||||
|
||||
_scope ??= ScopeFactory.CreateScope();
|
||||
return _scope.ServiceProvider;
|
||||
}
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
if (!IsDisposed)
|
||||
{
|
||||
_scope?.Dispose();
|
||||
_scope = null;
|
||||
Dispose(disposing: true);
|
||||
IsDisposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A base class that creates a service provider scope, and resolves a service of type <typeparamref name="TService"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="TService">The service type.</typeparam>
|
||||
/// <remarks>
|
||||
/// Use the <see cref="OwningComponentBase{TService}"/> class as a base class to author components that control
|
||||
/// the lifetime of a service or multiple services. This is useful when using a transient or scoped service that
|
||||
/// requires disposal such as a repository or database abstraction. Using <see cref="OwningComponentBase{TService}"/>
|
||||
/// as a base class ensures that the service and relates services that share its scope are disposed with the component.
|
||||
/// </remarks>
|
||||
public abstract class OwningComponentBase<TService> : OwningComponentBase, IDisposable
|
||||
{
|
||||
private TService _item;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <typeparamref name="TService"/> that is associated with this component.
|
||||
/// </summary>
|
||||
protected TService Service
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(GetType().Name);
|
||||
}
|
||||
|
||||
// We cache this because we don't know the lifetime. We have to assume that it could be transient.
|
||||
_item ??= ScopedServices.GetRequiredService<TService>();
|
||||
return _item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -36,13 +36,13 @@ namespace Microsoft.AspNetCore.Components
|
|||
/// The content that will be displayed if the user is not authorized.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment<AuthenticationState> NotAuthorizedContent { get; set; }
|
||||
public RenderFragment<AuthenticationState> NotAuthorized { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The content that will be displayed while asynchronous authorization is in progress.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment AuthorizingContent { get; set; }
|
||||
public RenderFragment Authorizing { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Attach(RenderHandle renderHandle)
|
||||
|
|
@ -109,14 +109,14 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
|
||||
// Some authorization data exists, so we do need to wrap the fragment
|
||||
RenderFragment<AuthenticationState> authorizedContent = context => pageFragment;
|
||||
RenderFragment<AuthenticationState> authorized = context => pageFragment;
|
||||
return builder =>
|
||||
{
|
||||
builder.OpenComponent<AuthorizeViewWithSuppliedData>(0);
|
||||
builder.AddAttribute(1, nameof(AuthorizeViewWithSuppliedData.AuthorizeDataParam), authorizeData);
|
||||
builder.AddAttribute(2, nameof(AuthorizeViewWithSuppliedData.Authorized), authorizedContent);
|
||||
builder.AddAttribute(3, nameof(AuthorizeViewWithSuppliedData.NotAuthorized), NotAuthorizedContent ?? DefaultNotAuthorizedContent);
|
||||
builder.AddAttribute(4, nameof(AuthorizeViewWithSuppliedData.Authorizing), AuthorizingContent);
|
||||
builder.AddAttribute(2, nameof(AuthorizeViewWithSuppliedData.Authorized), authorized);
|
||||
builder.AddAttribute(3, nameof(AuthorizeViewWithSuppliedData.NotAuthorized), NotAuthorized ?? DefaultNotAuthorized);
|
||||
builder.AddAttribute(4, nameof(AuthorizeViewWithSuppliedData.Authorizing), Authorizing);
|
||||
builder.CloseComponent();
|
||||
};
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
|
||||
// There has to be some default content. If we render blank by default, developers
|
||||
// will find it hard to guess why their UI isn't appearing.
|
||||
private static RenderFragment DefaultNotAuthorizedContent(AuthenticationState authenticationState)
|
||||
private static RenderFragment DefaultNotAuthorized(AuthenticationState authenticationState)
|
||||
=> builder => builder.AddContent(0, "Not authorized");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,10 @@ namespace Microsoft.AspNetCore.Components.RenderTree
|
|||
if (oldKey != null || newKey != null)
|
||||
{
|
||||
#region "Get diff action by matching on key"
|
||||
// Regardless of whether these two keys match, since you are using keys, we want to validate at this point that there are no clashes
|
||||
// so ensure we've built the dictionary that will be used for lookups if any don't match
|
||||
keyedItemInfos ??= BuildKeyToInfoLookup(diffContext, origOldStartIndex, oldEndIndexExcl, origNewStartIndex, newEndIndexExcl);
|
||||
|
||||
if (Equals(oldKey, newKey))
|
||||
{
|
||||
// Keys match
|
||||
|
|
@ -108,11 +112,6 @@ namespace Microsoft.AspNetCore.Components.RenderTree
|
|||
else
|
||||
{
|
||||
// Keys don't match
|
||||
if (keyedItemInfos == null)
|
||||
{
|
||||
keyedItemInfos = BuildKeyToInfoLookup(diffContext, origOldStartIndex, oldEndIndexExcl, origNewStartIndex, newEndIndexExcl);
|
||||
}
|
||||
|
||||
var oldKeyItemInfo = oldKey != null ? keyedItemInfos[oldKey] : new KeyedItemInfo(-1, -1);
|
||||
var newKeyItemInfo = newKey != null ? keyedItemInfos[newKey] : new KeyedItemInfo(-1, -1);
|
||||
var oldKeyIsInNewTree = oldKeyItemInfo.NewIndex >= 0;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components.RenderTree;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
@ -21,6 +22,8 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
"area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"
|
||||
};
|
||||
|
||||
private static readonly Task CanceledRenderTask = Task.FromCanceled(new CancellationToken(canceled: true));
|
||||
|
||||
private readonly Func<string, string> _htmlEncoder;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -40,7 +43,19 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
/// <inheritdoc />
|
||||
protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
// By default we return a canceled task. This has the effect of making it so that the
|
||||
// OnAfterRenderAsync callbacks on components don't run by default.
|
||||
// This way, by default prerendering gets the correct behavior and other renderers
|
||||
// override the UpdateDisplayAsync method already, so those components can
|
||||
// either complete a task when the client acknowledges the render, or return a canceled task
|
||||
// when the renderer gets disposed.
|
||||
|
||||
// We believe that returning a canceled task is the right behavior as we expect that any class
|
||||
// that subclasses this class to provide an implementation for a given rendering scenario respects
|
||||
// the contract that OnAfterRender should only be called when the display has successfully been updated
|
||||
// and the application is interactive. (Element and component references are populated and JavaScript interop
|
||||
// is available).
|
||||
return CanceledRenderTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
}
|
||||
}
|
||||
|
||||
internal static void HandlingEvent(ILogger<Renderer> logger, ulong eventHandlerId, UIEventArgs eventArgs)
|
||||
internal static void HandlingEvent(ILogger<Renderer> logger, ulong eventHandlerId, EventArgs eventArgs)
|
||||
{
|
||||
_handlingEvent(logger, eventHandlerId, eventArgs?.Type ?? "null", null);
|
||||
_handlingEvent(logger, eventHandlerId, eventArgs?.GetType().Name ?? "null", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
/// A <see cref="Task"/> which will complete once all asynchronous processing related to the event
|
||||
/// has completed.
|
||||
/// </returns>
|
||||
public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo fieldInfo, UIEventArgs eventArgs)
|
||||
public virtual Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo fieldInfo, EventArgs eventArgs)
|
||||
{
|
||||
EnsureSynchronizationContext();
|
||||
|
||||
|
|
@ -445,8 +445,12 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
{
|
||||
if (updateDisplayTask.IsCanceled)
|
||||
{
|
||||
// The display update was cancelled (maybe due to a timeout on the components server-side case or due
|
||||
// to the renderer being disposed)
|
||||
// The display update was canceled.
|
||||
// This can be due to a timeout on the components server-side case, or the renderer being disposed.
|
||||
|
||||
// The latter case is normal during prerendering, as the render never fully completes (the display never
|
||||
// gets updated, no references get populated and JavaScript interop is not available) and we simply discard
|
||||
// the renderer after producing the prerendered content.
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
if (updateDisplayTask.IsFaulted)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
// 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.Components.Routing
|
||||
{
|
||||
/// <summary>
|
||||
/// An optional interface for <see cref="NavigationManager" /> implementations that must be initialized
|
||||
/// by the host.
|
||||
/// </summary>
|
||||
public interface IHostEnvironmentNavigationManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="NavigationManager" />.
|
||||
/// </summary>
|
||||
/// <param name="baseUri">The base URI.</param>
|
||||
/// <param name="uri">The absolute URI.</param>
|
||||
void Initialize(string baseUri, string uri);
|
||||
}
|
||||
}
|
||||
|
|
@ -6,9 +6,9 @@ using System;
|
|||
namespace Microsoft.AspNetCore.Components.Routing
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="EventArgs" /> for <see cref="IUriHelper.OnLocationChanged" />.
|
||||
/// <see cref="EventArgs" /> for <see cref="NavigationManager.LocationChanged" />.
|
||||
/// </summary>
|
||||
public readonly struct LocationChangedEventArgs
|
||||
public class LocationChangedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of <see cref="LocationChangedEventArgs" />.
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
bool _navigationInterceptionEnabled;
|
||||
ILogger<Router> _logger;
|
||||
|
||||
[Inject] private IUriHelper UriHelper { get; set; }
|
||||
[Inject] private NavigationManager NavigationManager { get; set; }
|
||||
|
||||
[Inject] private INavigationInterception NavigationInterception { get; set; }
|
||||
|
||||
|
|
@ -41,17 +41,17 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
/// <summary>
|
||||
/// Gets or sets the type of the component that should be used as a fallback when no match is found for the requested route.
|
||||
/// </summary>
|
||||
[Parameter] public RenderFragment NotFoundContent { get; set; }
|
||||
[Parameter] public RenderFragment NotFound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The content that will be displayed if the user is not authorized.
|
||||
/// </summary>
|
||||
[Parameter] public RenderFragment<AuthenticationState> NotAuthorizedContent { get; set; }
|
||||
[Parameter] public RenderFragment<AuthenticationState> NotAuthorized { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The content that will be displayed while asynchronous authorization is in progress.
|
||||
/// </summary>
|
||||
[Parameter] public RenderFragment AuthorizingContent { get; set; }
|
||||
[Parameter] public RenderFragment Authorizing { get; set; }
|
||||
|
||||
private RouteTable Routes { get; set; }
|
||||
|
||||
|
|
@ -60,9 +60,9 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
{
|
||||
_logger = LoggerFactory.CreateLogger<Router>();
|
||||
_renderHandle = renderHandle;
|
||||
_baseUri = UriHelper.GetBaseUri();
|
||||
_locationAbsolute = UriHelper.GetAbsoluteUri();
|
||||
UriHelper.OnLocationChanged += OnLocationChanged;
|
||||
_baseUri = NavigationManager.BaseUri;
|
||||
_locationAbsolute = NavigationManager.Uri;
|
||||
NavigationManager.LocationChanged += OnLocationChanged;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
UriHelper.OnLocationChanged -= OnLocationChanged;
|
||||
NavigationManager.LocationChanged -= OnLocationChanged;
|
||||
}
|
||||
|
||||
private string StringUntilAny(string str, char[] chars)
|
||||
|
|
@ -94,14 +94,14 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
builder.OpenComponent(0, typeof(PageDisplay));
|
||||
builder.AddAttribute(1, nameof(PageDisplay.Page), handler);
|
||||
builder.AddAttribute(2, nameof(PageDisplay.PageParameters), parameters);
|
||||
builder.AddAttribute(3, nameof(PageDisplay.NotAuthorizedContent), NotAuthorizedContent);
|
||||
builder.AddAttribute(4, nameof(PageDisplay.AuthorizingContent), AuthorizingContent);
|
||||
builder.AddAttribute(3, nameof(PageDisplay.NotAuthorized), NotAuthorized);
|
||||
builder.AddAttribute(4, nameof(PageDisplay.Authorizing), Authorizing);
|
||||
builder.CloseComponent();
|
||||
}
|
||||
|
||||
private void Refresh(bool isNavigationIntercepted)
|
||||
{
|
||||
var locationPath = UriHelper.ToBaseRelativePath(_baseUri, _locationAbsolute);
|
||||
var locationPath = NavigationManager.ToBaseRelativePath(_locationAbsolute);
|
||||
locationPath = StringUntilAny(locationPath, _queryOrHashStartChar);
|
||||
var context = new RouteContext(locationPath);
|
||||
Routes.Route(context);
|
||||
|
|
@ -120,19 +120,19 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!isNavigationIntercepted && NotFoundContent != null)
|
||||
if (!isNavigationIntercepted && NotFound != null)
|
||||
{
|
||||
Log.DisplayingNotFoundContent(_logger, locationPath, _baseUri);
|
||||
Log.DisplayingNotFound(_logger, locationPath, _baseUri);
|
||||
|
||||
// We did not find a Component that matches the route.
|
||||
// Only show the NotFoundContent if the application developer programatically got us here i.e we did not
|
||||
// Only show the NotFound if the application developer programatically got us here i.e we did not
|
||||
// intercept the navigation. In all other cases, force a browser navigation since this could be non-Blazor content.
|
||||
_renderHandle.Render(NotFoundContent);
|
||||
_renderHandle.Render(NotFound);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.NavigatingToExternalUri(_logger, _locationAbsolute, locationPath, _baseUri);
|
||||
UriHelper.NavigateTo(_locationAbsolute, forceLoad: true);
|
||||
NavigationManager.NavigateTo(_locationAbsolute, forceLoad: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -159,8 +159,8 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
|
||||
private static class Log
|
||||
{
|
||||
private static readonly Action<ILogger, string, string, Exception> _displayingNotFoundContent =
|
||||
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(1, "DisplayingNotFoundContent"), $"Displaying {nameof(NotFoundContent)} because path '{{Path}}' with base URI '{{BaseUri}}' does not match any component route");
|
||||
private static readonly Action<ILogger, string, string, Exception> _displayingNotFound =
|
||||
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(1, "DisplayingNotFound"), $"Displaying {nameof(NotFound)} because path '{{Path}}' with base URI '{{BaseUri}}' does not match any component route");
|
||||
|
||||
private static readonly Action<ILogger, Type, string, string, Exception> _navigatingToComponent =
|
||||
LoggerMessage.Define<Type, string, string>(LogLevel.Debug, new EventId(2, "NavigatingToComponent"), "Navigating to component {ComponentType} in response to path '{Path}' with base URI '{BaseUri}'");
|
||||
|
|
@ -168,9 +168,9 @@ namespace Microsoft.AspNetCore.Components.Routing
|
|||
private static readonly Action<ILogger, string, string, string, Exception> _navigatingToExternalUri =
|
||||
LoggerMessage.Define<string, string, string>(LogLevel.Debug, new EventId(3, "NavigatingToExternalUri"), "Navigating to non-component URI '{ExternalUri}' in response to path '{Path}' with base URI '{BaseUri}'");
|
||||
|
||||
internal static void DisplayingNotFoundContent(ILogger logger, string path, string baseUri)
|
||||
internal static void DisplayingNotFound(ILogger logger, string path, string baseUri)
|
||||
{
|
||||
_displayingNotFoundContent(logger, path, baseUri, null);
|
||||
_displayingNotFound(logger, path, baseUri, null);
|
||||
}
|
||||
|
||||
internal static void NavigatingToComponent(ILogger logger, Type componentType, string path, string baseUri)
|
||||
|
|
|
|||
|
|
@ -1,17 +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.
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Supplies information about an input change event that is being raised.
|
||||
/// </summary>
|
||||
public class UIChangeEventArgs : UIEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the new value of the input. This may be a <see cref="string"/>
|
||||
/// or a <see cref="bool"/>.
|
||||
/// </summary>
|
||||
public object Value { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,230 +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;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// A base class for <see cref="IUriHelper"/> implementations.
|
||||
/// </summary>
|
||||
public abstract class UriHelperBase : IUriHelper
|
||||
{
|
||||
private EventHandler<LocationChangedEventArgs> _onLocationChanged;
|
||||
|
||||
/// <summary>
|
||||
/// An event that fires when the navigation location has changed.
|
||||
/// </summary>
|
||||
public event EventHandler<LocationChangedEventArgs> OnLocationChanged
|
||||
{
|
||||
add
|
||||
{
|
||||
AssertInitialized();
|
||||
_onLocationChanged += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_onLocationChanged -= value;
|
||||
}
|
||||
}
|
||||
|
||||
// For the baseUri it's worth storing both the string form and Uri form and
|
||||
// keeping them in sync. These are always represented as absolute URIs with
|
||||
// a trailing slash.
|
||||
private Uri _baseUri;
|
||||
private string _baseUriString;
|
||||
|
||||
// The URI. Always represented an absolute URI.
|
||||
private string _uri;
|
||||
|
||||
private bool _isInitialized;
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The destination URI. This can be absolute, or relative to the base URI
|
||||
/// (as returned by <see cref="GetBaseUri"/>).</param>
|
||||
public void NavigateTo(string uri)
|
||||
{
|
||||
NavigateTo(uri, forceLoad: false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The destination URI. This can be absolute, or relative to the base URI
|
||||
/// (as returned by <see cref="GetBaseUri"/>).</param>
|
||||
/// <param name="forceLoad">If true, bypasses client-side routing and forces the browser to load the new page from the server, whether or not the URI would normally be handled by the client-side router.</param>
|
||||
public void NavigateTo(string uri, bool forceLoad)
|
||||
{
|
||||
AssertInitialized();
|
||||
NavigateToCore(uri, forceLoad);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">The destination URI. This can be absolute, or relative to the base URI
|
||||
/// (as returned by <see cref="GetBaseUri"/>).</param>
|
||||
/// <param name="forceLoad">If true, bypasses client-side routing and forces the browser to load the new page from the server, whether or not the URI would normally be handled by the client-side router.</param>
|
||||
protected abstract void NavigateToCore(string uri, bool forceLoad);
|
||||
|
||||
/// <summary>
|
||||
/// Called to initialize BaseURI and current URI before these values are used for the first time.
|
||||
/// Override this method to dynamically calculate these values.
|
||||
/// </summary>
|
||||
public virtual void InitializeState(string uriAbsolute, string baseUriAbsolute)
|
||||
{
|
||||
if (uriAbsolute == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(uriAbsolute));
|
||||
}
|
||||
|
||||
if (baseUriAbsolute == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(baseUriAbsolute));
|
||||
}
|
||||
|
||||
if (_isInitialized)
|
||||
{
|
||||
throw new InvalidOperationException($"'{typeof(UriHelperBase).Name}' already initialized.");
|
||||
}
|
||||
_isInitialized = true;
|
||||
|
||||
SetAbsoluteUri(uriAbsolute);
|
||||
SetAbsoluteBaseUri(baseUriAbsolute);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows derived classes to lazyly self initialize. It does nothing unless overriden.
|
||||
/// </summary>
|
||||
protected virtual void EnsureInitialized()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current absolute URI.
|
||||
/// </summary>
|
||||
/// <returns>The current absolute URI.</returns>
|
||||
public string GetAbsoluteUri()
|
||||
{
|
||||
AssertInitialized();
|
||||
return _uri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base URI (with trailing slash) that can be prepended before relative URI paths to
|
||||
/// produce an absolute URI. Typically this corresponds to the 'href' attribute on the
|
||||
/// document's <base> element.
|
||||
/// </summary>
|
||||
/// <returns>The URI prefix, which has a trailing slash.</returns>
|
||||
public virtual string GetBaseUri()
|
||||
{
|
||||
AssertInitialized();
|
||||
return _baseUriString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a relative URI into an absolute one (by resolving it
|
||||
/// relative to the current absolute URI).
|
||||
/// </summary>
|
||||
/// <param name="href">The relative URI.</param>
|
||||
/// <returns>The absolute URI.</returns>
|
||||
public Uri ToAbsoluteUri(string href)
|
||||
{
|
||||
AssertInitialized();
|
||||
return new Uri(_baseUri, href);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a base URI (e.g., one previously returned by <see cref="GetBaseUri"/>),
|
||||
/// converts an absolute URI into one relative to the base URI prefix.
|
||||
/// </summary>
|
||||
/// <param name="baseUri">
|
||||
/// The base URI prefix (e.g., previously returned by <see cref="GetBaseUri"/>).
|
||||
/// </param>
|
||||
/// <param name="locationAbsolute">An absolute URI that is within the space of the base URI.</param>
|
||||
/// <returns>A relative URI path.</returns>
|
||||
public string ToBaseRelativePath(string baseUri, string locationAbsolute)
|
||||
{
|
||||
if (locationAbsolute.StartsWith(baseUri, StringComparison.Ordinal))
|
||||
{
|
||||
// The absolute URI must be of the form "{baseUri}something" (where
|
||||
// baseUri ends with a slash), and from that we return "something"
|
||||
return locationAbsolute.Substring(baseUri.Length);
|
||||
}
|
||||
|
||||
var hashIndex = locationAbsolute.IndexOf('#');
|
||||
var locationAbsoluteNoHash = hashIndex < 0 ? locationAbsolute : locationAbsolute.Substring(0, hashIndex);
|
||||
if ($"{locationAbsoluteNoHash}/".Equals(baseUri, StringComparison.Ordinal))
|
||||
{
|
||||
// Special case: for the base URI "/something/", if you're at
|
||||
// "/something" then treat it as if you were at "/something/" (i.e.,
|
||||
// with the trailing slash). It's a bit ambiguous because we don't know
|
||||
// whether the server would return the same page whether or not the
|
||||
// slash is present, but ASP.NET Core at least does by default when
|
||||
// using PathBase.
|
||||
return locationAbsolute.Substring(baseUri.Length - 1);
|
||||
}
|
||||
|
||||
var message = $"The URI '{locationAbsolute}' is not contained by the base URI '{baseUri}'.";
|
||||
throw new ArgumentException(message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the URI to the provided value.
|
||||
/// </summary>
|
||||
/// <param name="uri">The URI. Must be an absolute URI.</param>
|
||||
/// <remarks>
|
||||
/// Calling <see cref="SetAbsoluteUri(string)"/> does not trigger <see cref="OnLocationChanged"/>.
|
||||
/// </remarks>
|
||||
protected void SetAbsoluteUri(string uri)
|
||||
{
|
||||
_uri = uri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the base URI to the provided value (after normalization).
|
||||
/// </summary>
|
||||
/// <param name="baseUri">The base URI. Must be an absolute URI.</param>
|
||||
/// <remarks>
|
||||
/// Calling <see cref="SetAbsoluteBaseUri(string)"/> does not trigger <see cref="OnLocationChanged"/>.
|
||||
/// </remarks>
|
||||
protected void SetAbsoluteBaseUri(string baseUri)
|
||||
{
|
||||
if (baseUri != null)
|
||||
{
|
||||
var lastSlashIndex = baseUri.LastIndexOf('/');
|
||||
if (lastSlashIndex >= 0)
|
||||
{
|
||||
baseUri = baseUri.Substring(0, lastSlashIndex + 1);
|
||||
}
|
||||
}
|
||||
|
||||
_baseUriString = baseUri ?? "/";
|
||||
_baseUri = new Uri(_baseUriString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Triggers the <see cref="OnLocationChanged"/> event with the current URI value.
|
||||
/// </summary>
|
||||
protected void TriggerOnLocationChanged(bool isinterceptedLink)
|
||||
{
|
||||
_onLocationChanged?.Invoke(this, new LocationChangedEventArgs(_uri, isinterceptedLink));
|
||||
}
|
||||
|
||||
private void AssertInitialized()
|
||||
{
|
||||
if (!_isInitialized)
|
||||
{
|
||||
EnsureInitialized();
|
||||
}
|
||||
|
||||
if (!_isInitialized)
|
||||
{
|
||||
throw new InvalidOperationException($"'{GetType().Name}' has not been initialized.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -53,13 +53,13 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void RendersNotAuthorizedContentIfNotAuthorized()
|
||||
public void RendersNotAuthorizedIfNotAuthorized()
|
||||
{
|
||||
// Arrange
|
||||
var authorizationService = new TestAuthorizationService();
|
||||
var renderer = CreateTestRenderer(authorizationService);
|
||||
var rootComponent = WrapInAuthorizeView(
|
||||
notAuthorizedContent:
|
||||
notAuthorized:
|
||||
context => builder => builder.AddContent(0, $"You are not authorized, even though we know you are {context.User.Identity.Name}"));
|
||||
rootComponent.AuthenticationState = CreateAuthenticationState("Nellie");
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void RendersNothingIfAuthorizedButNoChildContentOrAuthorizedContentProvided()
|
||||
public void RendersNothingIfAuthorizedButNoChildContentOrAuthorizedProvided()
|
||||
{
|
||||
// Arrange
|
||||
var authorizationService = new TestAuthorizationService();
|
||||
|
|
@ -152,14 +152,14 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void RendersAuthorizedContentIfAuthorized()
|
||||
public void RendersAuthorizedIfAuthorized()
|
||||
{
|
||||
// Arrange
|
||||
var authorizationService = new TestAuthorizationService();
|
||||
authorizationService.NextResult = AuthorizationResult.Success();
|
||||
var renderer = CreateTestRenderer(authorizationService);
|
||||
var rootComponent = WrapInAuthorizeView(
|
||||
authorizedContent: context => builder =>
|
||||
authorized: context => builder =>
|
||||
builder.AddContent(0, $"You are authenticated as {context.User.Identity.Name}"));
|
||||
rootComponent.AuthenticationState = CreateAuthenticationState("Nellie");
|
||||
|
||||
|
|
@ -235,13 +235,13 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void ThrowsIfBothChildContentAndAuthorizedContentProvided()
|
||||
public void ThrowsIfBothChildContentAndAuthorizedProvided()
|
||||
{
|
||||
// Arrange
|
||||
var authorizationService = new TestAuthorizationService();
|
||||
var renderer = CreateTestRenderer(authorizationService);
|
||||
var rootComponent = WrapInAuthorizeView(
|
||||
authorizedContent: context => builder => { },
|
||||
authorized: context => builder => { },
|
||||
childContent: context => builder => { });
|
||||
|
||||
// Act/Assert
|
||||
|
|
@ -260,7 +260,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var renderer = CreateTestRenderer(authorizationService);
|
||||
renderer.OnUpdateDisplayComplete = () => { @event.Set(); };
|
||||
var rootComponent = WrapInAuthorizeView(
|
||||
notAuthorizedContent:
|
||||
notAuthorized:
|
||||
context => builder => builder.AddContent(0, "You are not authorized"));
|
||||
var authTcs = new TaskCompletionSource<AuthenticationState>();
|
||||
rootComponent.AuthenticationState = authTcs.Task;
|
||||
|
|
@ -293,7 +293,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void RendersAuthorizingContentUntilAuthorizationCompleted()
|
||||
public void RendersAuthorizingUntilAuthorizationCompleted()
|
||||
{
|
||||
// Arrange
|
||||
var @event = new ManualResetEventSlim();
|
||||
|
|
@ -302,8 +302,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
var renderer = CreateTestRenderer(authorizationService);
|
||||
renderer.OnUpdateDisplayComplete = () => { @event.Set(); };
|
||||
var rootComponent = WrapInAuthorizeView(
|
||||
authorizingContent: builder => builder.AddContent(0, "Auth pending..."),
|
||||
authorizedContent: context => builder => builder.AddContent(0, $"Hello, {context.User.Identity.Name}!"));
|
||||
authorizing: builder => builder.AddContent(0, "Auth pending..."),
|
||||
authorized: context => builder => builder.AddContent(0, $"Hello, {context.User.Identity.Name}!"));
|
||||
var authTcs = new TaskCompletionSource<AuthenticationState>();
|
||||
rootComponent.AuthenticationState = authTcs.Task;
|
||||
|
||||
|
|
@ -447,9 +447,9 @@ namespace Microsoft.AspNetCore.Components
|
|||
|
||||
private static TestAuthStateProviderComponent WrapInAuthorizeView(
|
||||
RenderFragment<AuthenticationState> childContent = null,
|
||||
RenderFragment<AuthenticationState> authorizedContent = null,
|
||||
RenderFragment<AuthenticationState> notAuthorizedContent = null,
|
||||
RenderFragment authorizingContent = null,
|
||||
RenderFragment<AuthenticationState> authorized = null,
|
||||
RenderFragment<AuthenticationState> notAuthorized = null,
|
||||
RenderFragment authorizing = null,
|
||||
string policy = null,
|
||||
string roles = null,
|
||||
object resource = null)
|
||||
|
|
@ -458,9 +458,9 @@ namespace Microsoft.AspNetCore.Components
|
|||
{
|
||||
builder.OpenComponent<AuthorizeView>(0);
|
||||
builder.AddAttribute(1, nameof(AuthorizeView.ChildContent), childContent);
|
||||
builder.AddAttribute(2, nameof(AuthorizeView.Authorized), authorizedContent);
|
||||
builder.AddAttribute(3, nameof(AuthorizeView.NotAuthorized), notAuthorizedContent);
|
||||
builder.AddAttribute(4, nameof(AuthorizeView.Authorizing), authorizingContent);
|
||||
builder.AddAttribute(2, nameof(AuthorizeView.Authorized), authorized);
|
||||
builder.AddAttribute(3, nameof(AuthorizeView.NotAuthorized), notAuthorized);
|
||||
builder.AddAttribute(4, nameof(AuthorizeView.Authorizing), authorizing);
|
||||
builder.AddAttribute(5, nameof(AuthorizeView.Policy), policy);
|
||||
builder.AddAttribute(6, nameof(AuthorizeView.Roles), roles);
|
||||
builder.AddAttribute(7, nameof(AuthorizeView.Resource), resource);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var binder = EventCallback.Factory.CreateBinder(component, setter, value);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "not-an-integer!", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "not-an-integer!", });
|
||||
|
||||
Assert.Equal(17, value); // Setter not called
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var binder = EventCallback.Factory.CreateBinder(component, setter, value);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = string.Empty, });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = string.Empty, });
|
||||
|
||||
Assert.Equal(0, value); // Calls setter to apply default value for this type
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
// Act
|
||||
await Assert.ThrowsAsync<InvalidTimeZoneException>(() =>
|
||||
{
|
||||
return binder.InvokeAsync(new UIChangeEventArgs() { Value = "18", });
|
||||
return binder.InvokeAsync(new ChangeEventArgs() { Value = "18", });
|
||||
});
|
||||
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var binder = EventCallback.Factory.CreateBinder(component, setter, value);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "not-an-integer!", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "not-an-integer!", });
|
||||
|
||||
Assert.Equal(17, value); // Setter not called
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var binder = EventCallback.Factory.CreateBinder(component, setter, value);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "", });
|
||||
|
||||
Assert.Null(value); // Setter called
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -111,7 +111,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = "bye";
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue, });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue, });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -130,7 +130,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = true;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = true, });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = true, });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (bool?)true;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = true, });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = true, });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -168,7 +168,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = 42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -187,7 +187,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (int?)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -206,7 +206,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (long)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -225,7 +225,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (long?)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -244,7 +244,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (float)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -263,7 +263,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (float?)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -282,7 +282,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (double)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -301,7 +301,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (double?)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -320,7 +320,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (decimal)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -339,7 +339,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = (decimal?)42;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -358,7 +358,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = AttributeTargets.Class;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -377,7 +377,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = AttributeTargets.Class;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -396,7 +396,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -415,7 +415,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -435,7 +435,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -455,7 +455,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -474,7 +474,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -493,7 +493,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -513,7 +513,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -533,7 +533,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new DateTime(2018, 3, 4);
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(format), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -553,7 +553,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = Guid.NewGuid();
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -573,7 +573,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = Guid.NewGuid();
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -592,7 +592,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = new SecretMessage() { Message = "TypeConverter may be old, but it still works!", };
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(), });
|
||||
|
||||
Assert.Equal(expectedValue.Message, value.Message);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -627,7 +627,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = 42_000;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42 000,00", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42 000,00", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
@ -646,7 +646,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var expectedValue = 42_000;
|
||||
|
||||
// Act
|
||||
await binder.InvokeAsync(new UIChangeEventArgs() { Value = "42,000.00", });
|
||||
await binder.InvokeAsync(new ChangeEventArgs() { Value = "42,000.00", });
|
||||
|
||||
Assert.Equal(expectedValue, value);
|
||||
Assert.Equal(1, component.Count);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
public async Task EventCallbackOfT_Default()
|
||||
{
|
||||
// Arrange
|
||||
var callback = default(EventCallback<UIEventArgs>);
|
||||
var callback = default(EventCallback<EventArgs>);
|
||||
|
||||
// Act & Assert (Does not throw)
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
{
|
||||
// Arrange
|
||||
int runCount = 0;
|
||||
var callback = new EventCallback<UIEventArgs>(null, (Action)(() => runCount++));
|
||||
var callback = new EventCallback<EventArgs>(null, (Action)(() => runCount++));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var callback = new EventCallback(component, (Action)(() => runCount++));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
@ -104,8 +104,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Action<UIEventArgs>)((e) => { arg = e; runCount++; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Action<EventArgs>)((e) => { arg = e; runCount++; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -124,11 +124,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Action<UIEventArgs>)((e) => { arg = e; runCount++; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Action<EventArgs>)((e) => { arg = e; runCount++; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
@ -164,8 +164,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Action<UIEventArgs>)((e) => { arg = e; runCount++; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Action<EventArgs>)((e) => { arg = e; runCount++; }));
|
||||
|
||||
// Act & Assert
|
||||
await Assert.ThrowsAsync<ArgumentException>(() =>
|
||||
|
|
@ -202,7 +202,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var callback = new EventCallback(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
@ -217,8 +217,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Func<UIEventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -237,11 +237,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Func<UIEventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
@ -277,8 +277,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Func<UIEventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act & Assert
|
||||
await Assert.ThrowsAsync<ArgumentException>(() =>
|
||||
|
|
@ -294,7 +294,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Action)(() => runCount++));
|
||||
var callback = new EventCallback<EventArgs>(component, (Action)(() => runCount++));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -312,10 +312,10 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Action)(() => runCount++));
|
||||
var callback = new EventCallback<EventArgs>(component, (Action)(() => runCount++));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
@ -330,8 +330,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Action<UIEventArgs>)((e) => { arg = e; runCount++; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback<EventArgs>(component, (Action<EventArgs>)((e) => { arg = e; runCount++; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -350,11 +350,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Action<UIEventArgs>)((e) => { arg = e; runCount++; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback<EventArgs>(component, (Action<EventArgs>)((e) => { arg = e; runCount++; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
@ -370,7 +370,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
|
||||
var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -388,10 +388,10 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
|
||||
var callback = new EventCallback<EventArgs>(component, (Func<Task>)(() => { runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
@ -406,8 +406,8 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Func<UIEventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(null);
|
||||
|
|
@ -426,11 +426,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
var component = new EventCountingComponent();
|
||||
|
||||
int runCount = 0;
|
||||
UIEventArgs arg = null;
|
||||
var callback = new EventCallback<UIEventArgs>(component, (Func<UIEventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
EventArgs arg = null;
|
||||
var callback = new EventCallback<EventArgs>(component, (Func<EventArgs, Task>)((e) => { arg = e; runCount++; return Task.CompletedTask; }));
|
||||
|
||||
// Act
|
||||
await callback.InvokeAsync(new UIEventArgs());
|
||||
await callback.InvokeAsync(new EventArgs());
|
||||
|
||||
|
||||
// Assert
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void CanAddMessagesByRange()
|
||||
public void CanAddMessagesMultiple()
|
||||
{
|
||||
// Arrange
|
||||
var messages = new ValidationMessageStore(new EditContext(new object()));
|
||||
|
|
@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
var entries = new[] { "A", "B", "C" };
|
||||
|
||||
// Act
|
||||
messages.AddRange(field1, entries);
|
||||
messages.Add(field1, entries);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(entries, messages[field1]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,117 @@
|
|||
// 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 Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
public class NavigationManagerTest
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "scheme://host/")]
|
||||
[InlineData("scheme://host:123/", "scheme://host:123/")]
|
||||
[InlineData("scheme://host/path", "scheme://host/")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/")]
|
||||
[InlineData("scheme://host/path/page?query=string&another=here", "scheme://host/path/")]
|
||||
public void ComputesCorrectBaseUri(string baseUri, string expectedResult)
|
||||
{
|
||||
var actualResult = NavigationManager.NormalizeBaseUri(baseUri);
|
||||
Assert.Equal(expectedResult, actualResult);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "scheme://host", "")]
|
||||
[InlineData("scheme://host/", "scheme://host/", "")]
|
||||
[InlineData("scheme://host/", "scheme://host/path", "path")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/", "")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/more", "more")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path", "")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path#hash", "#hash")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/#hash", "#hash")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/path/more#hash", "more#hash")]
|
||||
public void ComputesCorrectValidBaseRelativePaths(string baseUri, string uri, string expectedResult)
|
||||
{
|
||||
var navigationManager = new TestNavigationManager(baseUri);
|
||||
|
||||
var actualResult = navigationManager.ToBaseRelativePath(uri);
|
||||
Assert.Equal(expectedResult, actualResult);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "otherscheme://host/")]
|
||||
[InlineData("scheme://host/", "scheme://otherhost/")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/")]
|
||||
public void Initialize_ThrowsForInvalidBaseRelativePaths(string baseUri, string absoluteUri)
|
||||
{
|
||||
var navigationManager = new TestNavigationManager();
|
||||
|
||||
var ex = Assert.Throws<ArgumentException>(() =>
|
||||
{
|
||||
navigationManager.Initialize(baseUri, absoluteUri);
|
||||
});
|
||||
|
||||
Assert.Equal(
|
||||
$"The URI '{absoluteUri}' is not contained by the base URI '{baseUri}'.",
|
||||
ex.Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "otherscheme://host/")]
|
||||
[InlineData("scheme://host/", "scheme://otherhost/")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/")]
|
||||
public void Uri_ThrowsForInvalidBaseRelativePaths(string baseUri, string absoluteUri)
|
||||
{
|
||||
var navigationManager = new TestNavigationManager(baseUri);
|
||||
|
||||
var ex = Assert.Throws<ArgumentException>(() =>
|
||||
{
|
||||
navigationManager.ToBaseRelativePath(absoluteUri);
|
||||
});
|
||||
|
||||
Assert.Equal(
|
||||
$"The URI '{absoluteUri}' is not contained by the base URI '{baseUri}'.",
|
||||
ex.Message);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("scheme://host/", "otherscheme://host/")]
|
||||
[InlineData("scheme://host/", "scheme://otherhost/")]
|
||||
[InlineData("scheme://host/path/", "scheme://host/")]
|
||||
public void ToBaseRelativePath_ThrowsForInvalidBaseRelativePaths(string baseUri, string absoluteUri)
|
||||
{
|
||||
var navigationManager = new TestNavigationManager(baseUri);
|
||||
|
||||
var ex = Assert.Throws<ArgumentException>(() =>
|
||||
{
|
||||
navigationManager.ToBaseRelativePath(absoluteUri);
|
||||
});
|
||||
|
||||
Assert.Equal(
|
||||
$"The URI '{absoluteUri}' is not contained by the base URI '{baseUri}'.",
|
||||
ex.Message);
|
||||
}
|
||||
|
||||
private class TestNavigationManager : NavigationManager
|
||||
{
|
||||
public TestNavigationManager()
|
||||
{
|
||||
}
|
||||
|
||||
public TestNavigationManager(string baseUri = null, string uri = null)
|
||||
{
|
||||
Initialize(baseUri ?? "http://example.com/", uri ?? baseUri ?? "http://example.com/welcome-page");
|
||||
}
|
||||
|
||||
public new void Initialize(string baseUri, string uri)
|
||||
{
|
||||
base.Initialize(baseUri, uri);
|
||||
}
|
||||
|
||||
protected override void NavigateToCore(string uri, bool forceLoad)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
// 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.Dynamic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Components.RenderTree;
|
||||
using Microsoft.AspNetCore.Components.Test.Helpers;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components
|
||||
{
|
||||
public class OwningComponentBaseTest
|
||||
{
|
||||
[Fact]
|
||||
public void CreatesScopeAndService()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
services.AddSingleton<Counter>();
|
||||
services.AddTransient<MyService>();
|
||||
var serviceProvider = services.BuildServiceProvider();
|
||||
|
||||
var counter = serviceProvider.GetRequiredService<Counter>();
|
||||
var renderer = new TestRenderer(serviceProvider);
|
||||
var component1 = renderer.InstantiateComponent<MyOwningComponent>();
|
||||
|
||||
Assert.NotNull(component1.MyService);
|
||||
Assert.Equal(1, counter.CreatedCount);
|
||||
Assert.Equal(0, counter.DisposedCount);
|
||||
|
||||
((IDisposable)component1).Dispose();
|
||||
Assert.Equal(1, counter.CreatedCount);
|
||||
Assert.Equal(1, counter.DisposedCount);
|
||||
}
|
||||
|
||||
private class Counter
|
||||
{
|
||||
public int CreatedCount { get; set; }
|
||||
public int DisposedCount { get; set; }
|
||||
}
|
||||
|
||||
private class MyService : IDisposable
|
||||
{
|
||||
public MyService(Counter counter)
|
||||
{
|
||||
Counter = counter;
|
||||
Counter.CreatedCount++;
|
||||
}
|
||||
|
||||
public Counter Counter { get; }
|
||||
|
||||
void IDisposable.Dispose() => Counter.DisposedCount++;
|
||||
}
|
||||
|
||||
private class MyOwningComponent : OwningComponentBase<MyService>
|
||||
{
|
||||
public MyService MyService => Service;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
{
|
||||
// Arrange
|
||||
var builder = new RenderTreeBuilder();
|
||||
Action<UIEventArgs> eventHandler = eventInfo => { };
|
||||
Action<EventArgs> eventHandler = eventInfo => { };
|
||||
|
||||
// Act
|
||||
builder.OpenElement(0, "myelement"); // 0: <myelement
|
||||
|
|
@ -261,7 +261,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
{
|
||||
// Arrange
|
||||
var builder = new RenderTreeBuilder();
|
||||
Action<UIEventArgs> eventHandler = eventInfo => { };
|
||||
Action<EventArgs> eventHandler = eventInfo => { };
|
||||
|
||||
// Act
|
||||
builder.OpenElement(0, "myelement");
|
||||
|
|
@ -428,7 +428,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
{
|
||||
builder.OpenElement(0, "some element");
|
||||
builder.AddContent(1, "hello");
|
||||
builder.AddAttribute(2, "name", new Action<UIEventArgs>(eventInfo => { }));
|
||||
builder.AddAttribute(2, "name", new Action<EventArgs>(eventInfo => { }));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -897,7 +897,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Arrange
|
||||
var builder = new RenderTreeBuilder();
|
||||
|
||||
var value = new Action<UIEventArgs>((e) => { });
|
||||
var value = new Action<EventArgs>((e) => { });
|
||||
|
||||
// Act
|
||||
builder.OpenElement(0, "elem");
|
||||
|
|
@ -919,7 +919,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
|
||||
// Act
|
||||
builder.OpenElement(0, "elem");
|
||||
builder.AddAttribute(1, "attr", (Action<UIEventArgs>)null);
|
||||
builder.AddAttribute(1, "attr", (Action<EventArgs>)null);
|
||||
builder.CloseElement();
|
||||
|
||||
// Assert
|
||||
|
|
@ -965,7 +965,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
frame => AssertFrame.Element(frame, "elem", 1, 0));
|
||||
}
|
||||
|
||||
public static TheoryData<Action<UIEventArgs>> EventHandlerValues => new TheoryData<Action<UIEventArgs>>
|
||||
public static TheoryData<Action<EventArgs>> EventHandlerValues => new TheoryData<Action<EventArgs>>
|
||||
{
|
||||
null,
|
||||
(e) => { },
|
||||
|
|
@ -973,7 +973,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
|
||||
[Theory]
|
||||
[MemberData(nameof(EventHandlerValues))]
|
||||
public void AddAttribute_Component_EventHandlerValue_SetsAttributeValue(Action<UIEventArgs> value)
|
||||
public void AddAttribute_Component_EventHandlerValue_SetsAttributeValue(Action<EventArgs> value)
|
||||
{
|
||||
// Arrange
|
||||
var builder = new RenderTreeBuilder();
|
||||
|
|
@ -1241,7 +1241,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Arrange
|
||||
var builder = new RenderTreeBuilder();
|
||||
|
||||
var value = new Action<UIEventArgs>((e) => { });
|
||||
var value = new Action<EventArgs>((e) => { });
|
||||
|
||||
// Act
|
||||
builder.OpenElement(0, "elem");
|
||||
|
|
@ -1261,7 +1261,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Arrange
|
||||
var builder = new RenderTreeBuilder();
|
||||
|
||||
var value = new Action<UIEventArgs>((e) => { });
|
||||
var value = new Action<EventArgs>((e) => { });
|
||||
|
||||
// Act
|
||||
builder.OpenComponent<TestComponent>(0);
|
||||
|
|
|
|||
|
|
@ -360,6 +360,23 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
Assert.Equal("More than one sibling has the same key value, 'key1'. Key values must be unique.", ex.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RejectsClashingKeysEvenIfAllPairsMatch()
|
||||
{
|
||||
// This sort of scenario would happen if you accidentally used a constant value for @key
|
||||
|
||||
// Arrange
|
||||
AddWithKey(oldTree, "key1", "attrib1a");
|
||||
AddWithKey(oldTree, "key1", "attrib1b");
|
||||
|
||||
AddWithKey(newTree, "key1", "attrib1a");
|
||||
AddWithKey(newTree, "key1", "attrib1b");
|
||||
|
||||
// Act/Assert
|
||||
var ex = Assert.Throws<InvalidOperationException>(() => GetSingleUpdatedComponent());
|
||||
Assert.Equal("More than one sibling has the same key value, 'key1'. Key values must be unique.", ex.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HandlesInsertionOfUnkeyedItemsAroundKey()
|
||||
{
|
||||
|
|
@ -835,9 +852,9 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
public void RecognizesAttributeEventHandlerValuesChanged()
|
||||
{
|
||||
// Arrange
|
||||
Action<UIEventArgs> retainedHandler = _ => { };
|
||||
Action<UIEventArgs> removedHandler = _ => { };
|
||||
Action<UIEventArgs> addedHandler = _ => { };
|
||||
Action<EventArgs> retainedHandler = _ => { };
|
||||
Action<EventArgs> removedHandler = _ => { };
|
||||
Action<EventArgs> addedHandler = _ => { };
|
||||
oldTree.OpenElement(0, "My element");
|
||||
oldTree.AddAttribute(1, "onfoo", retainedHandler);
|
||||
oldTree.AddAttribute(2, "onbar", removedHandler);
|
||||
|
|
@ -1575,7 +1592,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
public void PreservesEventHandlerIdsForRetainedEventHandlers()
|
||||
{
|
||||
// Arrange
|
||||
Action<UIEventArgs> retainedHandler = _ => { };
|
||||
Action<EventArgs> retainedHandler = _ => { };
|
||||
oldTree.OpenElement(0, "My element");
|
||||
oldTree.AddAttribute(1, "ontest", retainedHandler);
|
||||
oldTree.CloseElement();
|
||||
|
|
@ -1601,7 +1618,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
public void PreservesEventHandlerIdsForRetainedEventHandlers_SlowPath()
|
||||
{
|
||||
// Arrange
|
||||
Action<UIEventArgs> retainedHandler = _ => { };
|
||||
Action<EventArgs> retainedHandler = _ => { };
|
||||
oldTree.OpenElement(0, "My element");
|
||||
oldTree.AddAttribute(0, "ontest", retainedHandler);
|
||||
oldTree.CloseElement();
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
{
|
||||
// Arrange: Render a component with an event handler
|
||||
var renderer = new TestRenderer();
|
||||
UIEventArgs receivedArgs = null;
|
||||
EventArgs receivedArgs = null;
|
||||
|
||||
var component = new EventComponent
|
||||
{
|
||||
|
|
@ -448,7 +448,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
Assert.Null(receivedArgs);
|
||||
|
||||
// Act/Assert: Event can be fired
|
||||
var eventArgs = new UIEventArgs();
|
||||
var eventArgs = new EventArgs();
|
||||
var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs);
|
||||
|
||||
// This should always be run synchronously
|
||||
|
|
@ -460,7 +460,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
{
|
||||
// Arrange: Render a component with an event handler
|
||||
var renderer = new TestRenderer();
|
||||
UIEventArgs receivedArgs = null;
|
||||
EventArgs receivedArgs = null;
|
||||
|
||||
var component = new EventComponent
|
||||
{
|
||||
|
|
@ -478,7 +478,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
Assert.Null(receivedArgs);
|
||||
|
||||
// Act/Assert: Event can be fired
|
||||
var eventArgs = new UIEventArgs();
|
||||
var eventArgs = new EventArgs();
|
||||
var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs);
|
||||
Assert.True(renderTask.IsCompletedSuccessfully);
|
||||
Assert.Same(eventArgs, receivedArgs);
|
||||
|
|
@ -508,7 +508,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
Assert.Empty(renderer.HandledExceptions);
|
||||
|
||||
// Act/Assert: Event can be fired
|
||||
var eventArgs = new UIEventArgs();
|
||||
var eventArgs = new EventArgs();
|
||||
var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs);
|
||||
Assert.True(renderTask.IsCompletedSuccessfully);
|
||||
|
||||
|
|
@ -577,7 +577,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
[Fact]
|
||||
public void CanDispatchEventsToNestedComponents()
|
||||
{
|
||||
UIEventArgs receivedArgs = null;
|
||||
EventArgs receivedArgs = null;
|
||||
|
||||
// Arrange: Render parent component
|
||||
var renderer = new TestRenderer();
|
||||
|
|
@ -608,7 +608,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
Assert.Null(receivedArgs);
|
||||
|
||||
// Act/Assert: Event can be fired
|
||||
var eventArgs = new UIEventArgs();
|
||||
var eventArgs = new EventArgs();
|
||||
var renderTask = renderer.DispatchEventAsync(eventHandlerId, eventArgs);
|
||||
Assert.True(renderTask.IsCompletedSuccessfully);
|
||||
Assert.Same(eventArgs, receivedArgs);
|
||||
|
|
@ -619,7 +619,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
{
|
||||
// Arrange: Render a component with an event handler
|
||||
var renderer = new TestRenderer();
|
||||
UIEventArgs receivedArgs = null;
|
||||
EventArgs receivedArgs = null;
|
||||
|
||||
var state = 0;
|
||||
var tcs = new TaskCompletionSource<object>();
|
||||
|
|
@ -646,7 +646,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
Assert.Null(receivedArgs);
|
||||
|
||||
// Act/Assert: Event can be fired
|
||||
var eventArgs = new UIEventArgs();
|
||||
var eventArgs = new EventArgs();
|
||||
var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs);
|
||||
Assert.Equal(1, state);
|
||||
Assert.Same(eventArgs, receivedArgs);
|
||||
|
|
@ -746,7 +746,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
[Fact]
|
||||
public async Task CanAsyncDispatchEventsToNestedComponents()
|
||||
{
|
||||
UIEventArgs receivedArgs = null;
|
||||
EventArgs receivedArgs = null;
|
||||
|
||||
var state = 0;
|
||||
var tcs = new TaskCompletionSource<object>();
|
||||
|
|
@ -786,7 +786,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
Assert.Null(receivedArgs);
|
||||
|
||||
// Act/Assert: Event can be fired
|
||||
var eventArgs = new UIEventArgs();
|
||||
var eventArgs = new EventArgs();
|
||||
var task = renderer.DispatchEventAsync(eventHandlerId, eventArgs);
|
||||
Assert.Equal(1, state);
|
||||
Assert.Same(eventArgs, receivedArgs);
|
||||
|
|
@ -1774,7 +1774,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Act/Assert
|
||||
await Assert.ThrowsAsync<ArgumentException>(() =>
|
||||
{
|
||||
return renderer.DispatchEventAsync(0, new UIEventArgs());
|
||||
return renderer.DispatchEventAsync(0, new EventArgs());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -2052,7 +2052,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Arrange
|
||||
var renderer = new TestRenderer();
|
||||
var eventCount = 0;
|
||||
Action<UIEventArgs> origEventHandler = args => { eventCount++; };
|
||||
Action<EventArgs> origEventHandler = args => { eventCount++; };
|
||||
var component = new EventComponent { OnTest = origEventHandler };
|
||||
var componentId = renderer.AssignRootComponentId(component);
|
||||
component.TriggerRender();
|
||||
|
|
@ -2094,7 +2094,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Arrange
|
||||
var renderer = new TestRenderer();
|
||||
var eventCount = 0;
|
||||
Action<UIEventArgs> origEventHandler = args => { eventCount++; };
|
||||
Action<EventArgs> origEventHandler = args => { eventCount++; };
|
||||
var component = new EventComponent { OnTest = origEventHandler };
|
||||
var componentId = renderer.AssignRootComponentId(component);
|
||||
component.TriggerRender();
|
||||
|
|
@ -2129,7 +2129,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Arrange
|
||||
var renderer = new TestRenderer();
|
||||
var eventCount = 0;
|
||||
Action<UIEventArgs> origEventHandler = args => { eventCount++; };
|
||||
Action<EventArgs> origEventHandler = args => { eventCount++; };
|
||||
var component = new ConditionalParentComponent<EventComponent>
|
||||
{
|
||||
IncludeChild = true,
|
||||
|
|
@ -2180,7 +2180,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Arrange
|
||||
var renderer = new TestRenderer();
|
||||
var eventCount = 0;
|
||||
Action<UIEventArgs> origEventHandler = args => { eventCount++; };
|
||||
Action<EventArgs> origEventHandler = args => { eventCount++; };
|
||||
var component = new EventComponent { OnTest = origEventHandler };
|
||||
var componentId = renderer.AssignRootComponentId(component);
|
||||
component.TriggerRender();
|
||||
|
|
@ -2222,7 +2222,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
{
|
||||
builder.AddContent(0, "Child event count: " + eventCount);
|
||||
builder.OpenComponent<EventComponent>(1);
|
||||
builder.AddAttribute(2, nameof(EventComponent.OnTest), new Action<UIEventArgs>(args =>
|
||||
builder.AddAttribute(2, nameof(EventComponent.OnTest), new Action<EventArgs>(args =>
|
||||
{
|
||||
eventCount++;
|
||||
rootComponent.TriggerRender();
|
||||
|
|
@ -2468,7 +2468,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
.AttributeEventHandlerId;
|
||||
|
||||
// Act: Toggle the checkbox
|
||||
var eventArgs = new UIChangeEventArgs { Value = true };
|
||||
var eventArgs = new ChangeEventArgs { Value = true };
|
||||
var renderTask = renderer.DispatchEventAsync(checkboxChangeEventHandlerId, eventArgs);
|
||||
|
||||
Assert.True(renderTask.IsCompletedSuccessfully);
|
||||
|
|
@ -2713,7 +2713,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
};
|
||||
var numEventsFired = 0;
|
||||
EventComponent component = null;
|
||||
Action<UIEventArgs> eventHandler = null;
|
||||
Action<EventArgs> eventHandler = null;
|
||||
|
||||
eventHandler = _ =>
|
||||
{
|
||||
|
|
@ -2737,14 +2737,14 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// Act/Assert 1: Event can be fired for the first time
|
||||
var render1TCS = new TaskCompletionSource<object>();
|
||||
renderer.NextUpdateDisplayReturnTask = render1TCS.Task;
|
||||
await renderer.DispatchEventAsync(eventHandlerId, new UIEventArgs());
|
||||
await renderer.DispatchEventAsync(eventHandlerId, new EventArgs());
|
||||
Assert.Equal(1, numEventsFired);
|
||||
|
||||
// Act/Assert 2: *Same* event handler ID can be reused prior to completion of
|
||||
// preceding UI update
|
||||
var render2TCS = new TaskCompletionSource<object>();
|
||||
renderer.NextUpdateDisplayReturnTask = render2TCS.Task;
|
||||
await renderer.DispatchEventAsync(eventHandlerId, new UIEventArgs());
|
||||
await renderer.DispatchEventAsync(eventHandlerId, new EventArgs());
|
||||
Assert.Equal(2, numEventsFired);
|
||||
|
||||
// Act/Assert 3: After we complete the first UI update in which a given
|
||||
|
|
@ -2760,7 +2760,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
await awaitableTask;
|
||||
var ex = await Assert.ThrowsAsync<ArgumentException>(() =>
|
||||
{
|
||||
return renderer.DispatchEventAsync(eventHandlerId, new UIEventArgs());
|
||||
return renderer.DispatchEventAsync(eventHandlerId, new EventArgs());
|
||||
});
|
||||
Assert.Equal($"There is no event handler with ID {eventHandlerId}", ex.Message);
|
||||
Assert.Equal(2, numEventsFired);
|
||||
|
|
@ -3318,7 +3318,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
FieldValue = "new property value",
|
||||
ComponentId = componentId
|
||||
};
|
||||
var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, eventFieldInfo, new UIChangeEventArgs
|
||||
var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, eventFieldInfo, new ChangeEventArgs
|
||||
{
|
||||
Value = "new property value"
|
||||
});
|
||||
|
|
@ -3336,7 +3336,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// show that the diff does *not* update the BoundString value attribute.
|
||||
Assert.Equal(RenderTreeEditType.SetAttribute, edit.Type);
|
||||
var attributeFrame = batch2.ReferenceFrames[edit.ReferenceFrameIndex];
|
||||
AssertFrame.Attribute(attributeFrame, "ontestevent", typeof(Action<UIChangeEventArgs>));
|
||||
AssertFrame.Attribute(attributeFrame, "ontestevent", typeof(Action<ChangeEventArgs>));
|
||||
Assert.NotEqual(default, attributeFrame.AttributeEventHandlerId);
|
||||
Assert.NotEqual(eventHandlerId, attributeFrame.AttributeEventHandlerId);
|
||||
});
|
||||
|
|
@ -3370,7 +3370,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
ComponentId = componentId,
|
||||
FieldValue = newPropertyValue,
|
||||
};
|
||||
var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, fieldInfo, new UIChangeEventArgs
|
||||
var dispatchEventTask = renderer.DispatchEventAsync(eventHandlerId, fieldInfo, new ChangeEventArgs
|
||||
{
|
||||
Value = newPropertyValue
|
||||
});
|
||||
|
|
@ -3388,7 +3388,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
// show that the diff does *not* update the BoundString value attribute.
|
||||
Assert.Equal(RenderTreeEditType.SetAttribute, edit.Type);
|
||||
var attributeFrame = latestBatch.ReferenceFrames[edit.ReferenceFrameIndex];
|
||||
AssertFrame.Attribute(attributeFrame, "ontestevent", typeof(Action<UIChangeEventArgs>));
|
||||
AssertFrame.Attribute(attributeFrame, "ontestevent", typeof(Action<ChangeEventArgs>));
|
||||
Assert.NotEqual(default, attributeFrame.AttributeEventHandlerId);
|
||||
Assert.NotEqual(eventHandlerId, attributeFrame.AttributeEventHandlerId);
|
||||
});
|
||||
|
|
@ -3507,10 +3507,10 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
private class EventComponent : AutoRenderComponent, IComponent, IHandleEvent
|
||||
{
|
||||
[Parameter]
|
||||
public Action<UIEventArgs> OnTest { get; set; }
|
||||
public Action<EventArgs> OnTest { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Func<UIEventArgs, Task> OnTestAsync { get; set; }
|
||||
public Func<EventArgs, Task> OnTestAsync { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Action<DerivedEventArgs> OnClick { get; set; }
|
||||
|
|
@ -3664,7 +3664,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
=> _renderHandle.Render(builder =>
|
||||
{
|
||||
builder.OpenElement(0, "my button");
|
||||
builder.AddAttribute(1, "my click handler", new Action<UIEventArgs>(eventArgs => OnClick(eventArgs)));
|
||||
builder.AddAttribute(1, "my click handler", new Action<EventArgs>(eventArgs => OnClick(eventArgs)));
|
||||
builder.CloseElement();
|
||||
});
|
||||
}
|
||||
|
|
@ -4095,7 +4095,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
|
||||
builder.OpenElement(0, "element with event");
|
||||
builder.AddAttribute(1, nameof(BoundString), BoundString);
|
||||
builder.AddAttribute(2, "ontestevent", new Action<UIChangeEventArgs>((UIChangeEventArgs eventArgs) =>
|
||||
builder.AddAttribute(2, "ontestevent", new Action<ChangeEventArgs>((ChangeEventArgs eventArgs) =>
|
||||
{
|
||||
BoundString = (string)eventArgs.Value;
|
||||
TriggerRender();
|
||||
|
|
@ -4106,7 +4106,7 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
}
|
||||
}
|
||||
|
||||
private class DerivedEventArgs : UIEventArgs
|
||||
private class DerivedEventArgs : EventArgs
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
{
|
||||
rtb.OpenElement(0, "p");
|
||||
rtb.OpenElement(1, "input");
|
||||
rtb.AddAttribute(2, "change", pc.GetValueOrDefault<Action<UIChangeEventArgs>>("update"));
|
||||
rtb.AddAttribute(2, "change", pc.GetValueOrDefault<Action<ChangeEventArgs>>("update"));
|
||||
rtb.AddAttribute(3, "value", pc.GetValueOrDefault<int>("value"));
|
||||
rtb.CloseElement();
|
||||
rtb.CloseElement();
|
||||
|
|
@ -354,7 +354,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
.BuildServiceProvider();
|
||||
|
||||
var htmlRenderer = GetHtmlRenderer(serviceProvider);
|
||||
Action<UIChangeEventArgs> change = (UIChangeEventArgs changeArgs) => throw new InvalidOperationException();
|
||||
Action<ChangeEventArgs> change = (ChangeEventArgs changeArgs) => throw new InvalidOperationException();
|
||||
|
||||
// Act
|
||||
var result = GetResult(htmlRenderer.Dispatcher.InvokeAsync(() => htmlRenderer.RenderComponentAsync<ComponentWithParameters>(
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
<Compile Include="Microsoft.AspNetCore.Components.Server.netcoreapp3.0.cs" />
|
||||
<Reference Include="Microsoft.AspNetCore.Components.Web" />
|
||||
<Reference Include="Microsoft.AspNetCore.DataProtection" />
|
||||
<Reference Include="Microsoft.Extensions.Logging" />
|
||||
<Reference Include="Microsoft.AspNetCore.SignalR" />
|
||||
<Reference Include="Microsoft.AspNetCore.StaticFiles" />
|
||||
<Reference Include="Microsoft.Extensions.Caching.Memory" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Composite" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
|
||||
<Reference Include="Microsoft.Extensions.Logging" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ namespace Microsoft.AspNetCore.Builder
|
|||
}
|
||||
public static partial class ComponentEndpointRouteBuilderExtensions
|
||||
{
|
||||
public static Microsoft.AspNetCore.Builder.ComponentEndpointConventionBuilder MapBlazorHub(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints) { throw null; }
|
||||
public static Microsoft.AspNetCore.Builder.ComponentEndpointConventionBuilder MapBlazorHub(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, System.Action<Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions> configureOptions) { throw null; }
|
||||
public static Microsoft.AspNetCore.Builder.ComponentEndpointConventionBuilder MapBlazorHub(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, System.Type type, string selector) { throw null; }
|
||||
public static Microsoft.AspNetCore.Builder.ComponentEndpointConventionBuilder MapBlazorHub(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, System.Type type, string selector, System.Action<Microsoft.AspNetCore.Http.Connections.HttpConnectionDispatcherOptions> configureOptions) { throw null; }
|
||||
public static Microsoft.AspNetCore.Builder.ComponentEndpointConventionBuilder MapBlazorHub(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, System.Type componentType, string selector, string path) { throw null; }
|
||||
|
|
@ -36,22 +34,6 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
public System.TimeSpan DisconnectedCircuitRetentionPeriod { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public System.TimeSpan JSInteropDefaultCallTimeout { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class ComponentPrerenderingContext
|
||||
{
|
||||
public ComponentPrerenderingContext() { }
|
||||
public System.Type ComponentType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Http.HttpContext Context { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.ParameterView Parameters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public sealed partial class ComponentPrerenderResult
|
||||
{
|
||||
internal ComponentPrerenderResult() { }
|
||||
public void WriteTo(System.IO.TextWriter writer) { }
|
||||
}
|
||||
public partial interface IComponentPrerenderer
|
||||
{
|
||||
System.Threading.Tasks.Task<Microsoft.AspNetCore.Components.Server.ComponentPrerenderResult> PrerenderComponentAsync(Microsoft.AspNetCore.Components.Server.ComponentPrerenderingContext context);
|
||||
}
|
||||
}
|
||||
namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||
{
|
||||
|
|
@ -69,15 +51,6 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
public virtual System.Threading.Tasks.Task OnConnectionDownAsync(Microsoft.AspNetCore.Components.Server.Circuits.Circuit circuit, System.Threading.CancellationToken cancellationToken) { throw null; }
|
||||
public virtual System.Threading.Tasks.Task OnConnectionUpAsync(Microsoft.AspNetCore.Components.Server.Circuits.Circuit circuit, System.Threading.CancellationToken cancellationToken) { throw null; }
|
||||
}
|
||||
public partial class RemoteUriHelper : Microsoft.AspNetCore.Components.UriHelperBase
|
||||
{
|
||||
public RemoteUriHelper(Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Components.Server.Circuits.RemoteUriHelper> logger) { }
|
||||
public bool HasAttachedJSRuntime { get { throw null; } }
|
||||
public override void InitializeState(string uriAbsolute, string baseUriAbsolute) { }
|
||||
protected override void NavigateToCore(string uri, bool forceLoad) { }
|
||||
[Microsoft.JSInterop.JSInvokableAttribute("NotifyLocationChanged")]
|
||||
public static void NotifyLocationChanged(string uriAbsolute, bool isInterceptedLink) { }
|
||||
}
|
||||
}
|
||||
namespace Microsoft.Extensions.DependencyInjection
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,42 +15,6 @@ namespace Microsoft.AspNetCore.Builder
|
|||
/// </summary>
|
||||
public static class ComponentEndpointRouteBuilderExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Maps the Blazor <see cref="Hub" /> to the default path.
|
||||
/// </summary>
|
||||
/// <param name="endpoints">The <see cref="IEndpointRouteBuilder"/>.</param>
|
||||
/// <returns>The <see cref="ComponentEndpointConventionBuilder"/>.</returns>
|
||||
public static ComponentEndpointConventionBuilder MapBlazorHub(this IEndpointRouteBuilder endpoints)
|
||||
{
|
||||
if (endpoints == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(endpoints));
|
||||
}
|
||||
|
||||
return endpoints.MapBlazorHub(configureOptions: _ => { });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maps the Blazor <see cref="Hub" /> to the default path.
|
||||
/// </summary>
|
||||
/// <param name="endpoints">The <see cref="IEndpointRouteBuilder"/>.</param>
|
||||
/// <param name="configureOptions">A callback to configure dispatcher options.</param>
|
||||
/// <returns>The <see cref="ComponentEndpointConventionBuilder"/>.</returns>
|
||||
public static ComponentEndpointConventionBuilder MapBlazorHub(this IEndpointRouteBuilder endpoints, Action<HttpConnectionDispatcherOptions> configureOptions)
|
||||
{
|
||||
if (endpoints == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(endpoints));
|
||||
}
|
||||
|
||||
if (configureOptions == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(configureOptions));
|
||||
}
|
||||
|
||||
return new ComponentEndpointConventionBuilder(endpoints.MapHub<ComponentHub>(ComponentHub.DefaultPath, configureOptions));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///Maps the Blazor <see cref="Hub" /> to the default path and associates
|
||||
/// the component <typeparamref name="TComponent"/> to this hub instance as the given DOM <paramref name="selector"/>.
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
public abstract CircuitHost CreateCircuitHost(
|
||||
HttpContext httpContext,
|
||||
CircuitClientProxy client,
|
||||
string uriAbsolute,
|
||||
string baseUriAbsolute,
|
||||
string baseUri,
|
||||
string uri,
|
||||
ClaimsPrincipal user);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ using System.Security.Claims;
|
|||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components.Rendering;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Rendering;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -19,31 +17,28 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
{
|
||||
internal class CircuitHost : IAsyncDisposable
|
||||
{
|
||||
private static readonly AsyncLocal<CircuitHost> _current = new AsyncLocal<CircuitHost>();
|
||||
private readonly SemaphoreSlim HandlerLock = new SemaphoreSlim(1);
|
||||
private readonly IServiceScope _scope;
|
||||
private readonly CircuitHandler[] _circuitHandlers;
|
||||
private readonly ILogger _logger;
|
||||
private bool _initialized;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="Circuit"/>, if any.
|
||||
/// </summary>
|
||||
public static CircuitHost Current => _current.Value;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the current <see cref="Circuits.Circuit"/>.
|
||||
/// </summary>
|
||||
/// <param name="circuitHost">The <see cref="Circuits.Circuit"/>.</param>
|
||||
/// <remarks>
|
||||
/// Calling <see cref="SetCurrentCircuitHost(CircuitHost)"/> will store the circuit
|
||||
/// and other related values such as the <see cref="IJSRuntime"/> and <see cref="Renderer"/>
|
||||
/// Calling <see cref="SetCurrentCircuitHost(CircuitHost)"/> will store related values such as the
|
||||
/// <see cref="IJSRuntime"/> and <see cref="Renderer"/>
|
||||
/// in the local execution context. Application code should not need to call this method,
|
||||
/// it is primarily used by the Server-Side Components infrastructure.
|
||||
/// </remarks>
|
||||
public static void SetCurrentCircuitHost(CircuitHost circuitHost)
|
||||
{
|
||||
_current.Value = circuitHost ?? throw new ArgumentNullException(nameof(circuitHost));
|
||||
if (circuitHost is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(circuitHost));
|
||||
}
|
||||
|
||||
JSInterop.JSRuntime.SetCurrentJSRuntime(circuitHost.JSRuntime);
|
||||
RendererRegistry.SetCurrentRendererRegistry(circuitHost.RendererRegistry);
|
||||
|
|
@ -57,7 +52,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
CircuitClientProxy client,
|
||||
RendererRegistry rendererRegistry,
|
||||
RemoteRenderer renderer,
|
||||
IList<ComponentDescriptor> descriptors,
|
||||
IReadOnlyList<ComponentDescriptor> descriptors,
|
||||
RemoteJSRuntime jsRuntime,
|
||||
CircuitHandler[] circuitHandlers,
|
||||
ILogger logger)
|
||||
|
|
@ -92,24 +87,10 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
|
||||
public RendererRegistry RendererRegistry { get; }
|
||||
|
||||
public IList<ComponentDescriptor> Descriptors { get; }
|
||||
public IReadOnlyList<ComponentDescriptor> Descriptors { get; }
|
||||
|
||||
public IServiceProvider Services { get; }
|
||||
|
||||
public Task<ComponentRenderedText> PrerenderComponentAsync(Type componentType, ParameterView parameters)
|
||||
{
|
||||
return Renderer.Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
var result = await Renderer.RenderComponentAsync(componentType, parameters);
|
||||
|
||||
// When we prerender we start the circuit in a disconnected state. As such, we only call
|
||||
// OnCircuitOpenenedAsync here and when the client reconnects we run OnConnectionUpAsync
|
||||
await OnCircuitOpenedAsync(CancellationToken.None);
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
public void SetCircuitUser(ClaimsPrincipal user)
|
||||
{
|
||||
var authenticationStateProvider = Services.GetService<AuthenticationStateProvider>() as IHostEnvironmentAuthenticationStateProvider;
|
||||
|
|
@ -120,26 +101,6 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
}
|
||||
}
|
||||
|
||||
internal void InitializeCircuitAfterPrerender(UnhandledExceptionEventHandler unhandledException)
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
_initialized = true;
|
||||
UnhandledException += unhandledException;
|
||||
var uriHelper = (RemoteUriHelper)Services.GetRequiredService<IUriHelper>();
|
||||
if (!uriHelper.HasAttachedJSRuntime)
|
||||
{
|
||||
uriHelper.AttachJsRuntime(JSRuntime);
|
||||
}
|
||||
|
||||
var navigationInterception = (RemoteNavigationInterception)Services.GetRequiredService<INavigationInterception>();
|
||||
if (!navigationInterception.HasAttachedJSRuntime)
|
||||
{
|
||||
navigationInterception.AttachJSRuntime(JSRuntime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void SendPendingBatches()
|
||||
{
|
||||
// Dispatch any buffered renders we accumulated during a disconnect.
|
||||
|
|
@ -188,7 +149,6 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
await Renderer.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
SetCurrentCircuitHost(this);
|
||||
|
|
@ -233,13 +193,11 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
// That's because AddComponentAsync waits for quiescence, which can take
|
||||
// arbitrarily long. In the meantime we might need to be receiving and
|
||||
// processing incoming JSInterop calls or similar.
|
||||
for (var i = 0; i < Descriptors.Count; i++)
|
||||
var count = Descriptors.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var (componentType, domElementSelector, prerendered) = Descriptors[i];
|
||||
if (!prerendered)
|
||||
{
|
||||
await Renderer.AddComponentAsync(componentType, domElementSelector);
|
||||
}
|
||||
var (componentType, domElementSelector) = Descriptors[i];
|
||||
await Renderer.AddComponentAsync(componentType, domElementSelector);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -256,7 +214,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
try
|
||||
{
|
||||
AssertInitialized();
|
||||
if(assemblyName == "Microsoft.AspNetCore.Components.Web" && methodIdentifier == "DispatchEvent")
|
||||
if (assemblyName == "Microsoft.AspNetCore.Components.Web" && methodIdentifier == "DispatchEvent")
|
||||
{
|
||||
Log.DispatchEventTroughJSInterop(_logger);
|
||||
return;
|
||||
|
|
@ -271,6 +229,38 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// We don't expect any of this code to actually throw, because DotNetDispatcher.BeginInvoke doesn't throw
|
||||
// however, we still want this to get logged if we do.
|
||||
UnhandledException?.Invoke(this, new UnhandledExceptionEventArgs(ex, isTerminating: false));
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnLocationChangedAsync(string uri, bool intercepted)
|
||||
{
|
||||
try
|
||||
{
|
||||
AssertInitialized();
|
||||
await Renderer.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
SetCurrentCircuitHost(this);
|
||||
Log.LocationChange(_logger, CircuitId, uri);
|
||||
var navigationManager = (RemoteNavigationManager)Services.GetRequiredService<NavigationManager>();
|
||||
navigationManager.NotifyLocationChanged(uri, intercepted);
|
||||
Log.LocationChangeSucceeded(_logger, CircuitId, uri);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// It's up to the NavigationManager implementation to validate the URI.
|
||||
//
|
||||
// Note that it's also possible that setting the URI could cause a failure in code that listens
|
||||
// to NavigationManager.LocationChanged.
|
||||
//
|
||||
// In either case, a well-behaved client will not send invalid URIs, and we don't really
|
||||
// want to continue processing with the circuit if setting the URI failed inside application
|
||||
// code. The safest thing to do is consider it a critical failure since URI is global state,
|
||||
// and a failure means that an update to global state was partially applied.
|
||||
Log.LocationChangeFailed(_logger, CircuitId, uri, ex);
|
||||
UnhandledException?.Invoke(this, new UnhandledExceptionEventArgs(ex, isTerminating: false));
|
||||
}
|
||||
}
|
||||
|
|
@ -423,6 +413,9 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
private static readonly Action<ILogger, Exception> _dispatchEventFailedToParseEventDescriptor;
|
||||
private static readonly Action<ILogger, string, Exception> _dispatchEventFailedToDispatchEvent;
|
||||
private static readonly Action<ILogger, Exception> _dispatchEventThroughJSInterop;
|
||||
private static readonly Action<ILogger, string, string, Exception> _locationChange;
|
||||
private static readonly Action<ILogger, string, string, Exception> _locationChangeSucceeded;
|
||||
private static readonly Action<ILogger, string, string, Exception> _locationChangeFailed;
|
||||
|
||||
private static class EventIds
|
||||
{
|
||||
|
|
@ -440,6 +433,9 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
public static readonly EventId EndInvokeJSFailed = new EventId(111, "EndInvokeJSFailed");
|
||||
public static readonly EventId EndInvokeJSSucceeded = new EventId(112, "EndInvokeJSSucceeded");
|
||||
public static readonly EventId DispatchEventThroughJSInterop = new EventId(113, "DispatchEventThroughJSInterop");
|
||||
public static readonly EventId LocationChange = new EventId(114, "LocationChange");
|
||||
public static readonly EventId LocationChangeSucceded = new EventId(115, "LocationChangeSucceeded");
|
||||
public static readonly EventId LocationChangeFailed = new EventId(116, "LocationChangeFailed");
|
||||
}
|
||||
|
||||
static Log()
|
||||
|
|
@ -513,6 +509,21 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
LogLevel.Debug,
|
||||
EventIds.DispatchEventThroughJSInterop,
|
||||
"There was an intent to dispatch a browser event through JS interop.");
|
||||
|
||||
_locationChange = LoggerMessage.Define<string, string>(
|
||||
LogLevel.Debug,
|
||||
EventIds.LocationChange,
|
||||
"Location changing to {URI} in {CircuitId}.");
|
||||
|
||||
_locationChangeSucceeded = LoggerMessage.Define<string, string>(
|
||||
LogLevel.Debug,
|
||||
EventIds.LocationChangeSucceded,
|
||||
"Location change to {URI} in {CircuitId} succeded.");
|
||||
|
||||
_locationChangeFailed = LoggerMessage.Define<string, string>(
|
||||
LogLevel.Debug,
|
||||
EventIds.LocationChangeFailed,
|
||||
"Location change to {URI} in {CircuitId} failed.");
|
||||
}
|
||||
|
||||
public static void UnhandledExceptionInvokingCircuitHandler(ILogger logger, CircuitHandler handler, string handlerMethod, Exception exception)
|
||||
|
|
@ -560,8 +571,13 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
}
|
||||
}
|
||||
|
||||
public static void DispatchEventTroughJSInterop(ILogger logger) =>
|
||||
_dispatchEventThroughJSInterop(logger, null);
|
||||
public static void DispatchEventTroughJSInterop(ILogger logger) => _dispatchEventThroughJSInterop(logger, null);
|
||||
|
||||
public static void LocationChange(ILogger logger, string circuitId, string uri) => _locationChange(logger, circuitId, uri, null);
|
||||
|
||||
public static void LocationChangeSucceeded(ILogger logger, string circuitId, string uri) => _locationChangeSucceeded(logger, circuitId, uri, null);
|
||||
|
||||
public static void LocationChangeFailed(ILogger logger, string circuitId, string uri, Exception exception) => _locationChangeFailed(logger, circuitId, uri, exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,207 +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;
|
||||
using System.Linq;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components.Rendering;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||
{
|
||||
internal class CircuitPrerenderer : IComponentPrerenderer
|
||||
{
|
||||
private static object CircuitHostKey = new object();
|
||||
private static object CancellationStatusKey = new object();
|
||||
private static readonly JsonSerializerOptions _jsonSerializationOptions =
|
||||
new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
|
||||
|
||||
private readonly CircuitFactory _circuitFactory;
|
||||
private readonly CircuitRegistry _registry;
|
||||
|
||||
public CircuitPrerenderer(
|
||||
CircuitFactory circuitFactory,
|
||||
CircuitRegistry registry)
|
||||
{
|
||||
_circuitFactory = circuitFactory;
|
||||
_registry = registry;
|
||||
}
|
||||
|
||||
public async Task<ComponentPrerenderResult> PrerenderComponentAsync(ComponentPrerenderingContext prerenderingContext)
|
||||
{
|
||||
var context = prerenderingContext.Context;
|
||||
var cancellationStatus = GetOrCreateCancellationStatus(context);
|
||||
if (cancellationStatus.Canceled)
|
||||
{
|
||||
// Avoid creating a circuit host if other component earlier in the pipeline already triggered
|
||||
// cancellation (e.g., by navigating or throwing). Instead render nothing.
|
||||
return new ComponentPrerenderResult(Array.Empty<string>());
|
||||
}
|
||||
var circuitHost = GetOrCreateCircuitHost(context, cancellationStatus);
|
||||
ComponentRenderedText renderResult;
|
||||
try
|
||||
{
|
||||
renderResult = await circuitHost.PrerenderComponentAsync(
|
||||
prerenderingContext.ComponentType,
|
||||
prerenderingContext.Parameters);
|
||||
}
|
||||
catch (NavigationException navigationException)
|
||||
{
|
||||
// Cleanup the state as we won't need it any longer.
|
||||
// Signal callbacks that we don't have to register the circuit.
|
||||
await CleanupCircuitState(context, cancellationStatus, circuitHost);
|
||||
|
||||
// Navigation was attempted during prerendering.
|
||||
if (prerenderingContext.Context.Response.HasStarted)
|
||||
{
|
||||
// We can't perform a redirect as the server already started sending the response.
|
||||
// This is considered an application error as the developer should buffer the response until
|
||||
// all components have rendered.
|
||||
throw new InvalidOperationException("A navigation command was attempted during prerendering after the server already started sending the response. " +
|
||||
"Navigation commands can not be issued during server-side prerendering after the response from the server has started. Applications must buffer the" +
|
||||
"reponse and avoid using features like FlushAsync() before all components on the page have been rendered to prevent failed navigation commands.", navigationException);
|
||||
}
|
||||
|
||||
context.Response.Redirect(navigationException.Location);
|
||||
return new ComponentPrerenderResult(Array.Empty<string>());
|
||||
}
|
||||
catch
|
||||
{
|
||||
// If prerendering any component fails, cancel prerendering entirely and dispose the DI scope
|
||||
await CleanupCircuitState(context, cancellationStatus, circuitHost);
|
||||
throw;
|
||||
}
|
||||
|
||||
circuitHost.Descriptors.Add(new ComponentDescriptor
|
||||
{
|
||||
ComponentType = prerenderingContext.ComponentType,
|
||||
Prerendered = true
|
||||
});
|
||||
|
||||
var record = JsonSerializer.Serialize(new PrerenderedComponentRecord(
|
||||
// We need to do this due to the fact that -- is not allowed within HTML comments and HTML doesn't encode '-'.
|
||||
// We will never have '..' sequences because we Base64UrlEncode the circuit id
|
||||
circuitHost.CircuitId.Replace("--", ".."),
|
||||
circuitHost.Renderer.Id,
|
||||
renderResult.ComponentId),
|
||||
_jsonSerializationOptions);
|
||||
|
||||
var result = (new[] {
|
||||
$"<!-- M.A.C.Component: {record} -->",
|
||||
}).Concat(renderResult.Tokens).Concat(
|
||||
new[] {
|
||||
$"<!-- M.A.C.Component: {renderResult.ComponentId} -->"
|
||||
});
|
||||
|
||||
return new ComponentPrerenderResult(result);
|
||||
}
|
||||
|
||||
private PrerenderingCancellationStatus GetOrCreateCancellationStatus(HttpContext context)
|
||||
{
|
||||
if (context.Items.TryGetValue(CancellationStatusKey, out var existingValue))
|
||||
{
|
||||
return (PrerenderingCancellationStatus)existingValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
var cancellationStatus = new PrerenderingCancellationStatus();
|
||||
context.Items[CancellationStatusKey] = cancellationStatus;
|
||||
return cancellationStatus;
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task CleanupCircuitState(HttpContext context, PrerenderingCancellationStatus cancellationStatus, CircuitHost circuitHost)
|
||||
{
|
||||
cancellationStatus.Canceled = true;
|
||||
context.Items.Remove(CircuitHostKey);
|
||||
await circuitHost.DisposeAsync();
|
||||
}
|
||||
|
||||
private CircuitHost GetOrCreateCircuitHost(HttpContext context, PrerenderingCancellationStatus cancellationStatus)
|
||||
{
|
||||
if (context.Items.TryGetValue(CircuitHostKey, out var existingHost))
|
||||
{
|
||||
return (CircuitHost)existingHost;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = _circuitFactory.CreateCircuitHost(
|
||||
context,
|
||||
client: new CircuitClientProxy(), // This creates an "offline" client.
|
||||
GetFullUri(context.Request),
|
||||
GetFullBaseUri(context.Request),
|
||||
context.User);
|
||||
|
||||
result.UnhandledException += CircuitHost_UnhandledException;
|
||||
context.Response.OnCompleted(() =>
|
||||
{
|
||||
result.UnhandledException -= CircuitHost_UnhandledException;
|
||||
if (!cancellationStatus.Canceled)
|
||||
{
|
||||
_registry.RegisterDisconnectedCircuit(result);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
context.Items.Add(CircuitHostKey, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private void CircuitHost_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
// Throw all exceptions encountered during pre-rendering so the default developer
|
||||
// error page can respond.
|
||||
ExceptionDispatchInfo.Capture((Exception)e.ExceptionObject).Throw();
|
||||
}
|
||||
|
||||
private string GetFullUri(HttpRequest request)
|
||||
{
|
||||
return UriHelper.BuildAbsolute(
|
||||
request.Scheme,
|
||||
request.Host,
|
||||
request.PathBase,
|
||||
request.Path,
|
||||
request.QueryString);
|
||||
}
|
||||
|
||||
private string GetFullBaseUri(HttpRequest request)
|
||||
{
|
||||
var result = UriHelper.BuildAbsolute(request.Scheme, request.Host, request.PathBase);
|
||||
|
||||
// PathBase may be "/" or "/some/thing", but to be a well-formed base URI
|
||||
// it has to end with a trailing slash
|
||||
if (!result.EndsWith('/'))
|
||||
{
|
||||
result += '/';
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private readonly struct PrerenderedComponentRecord
|
||||
{
|
||||
public PrerenderedComponentRecord(string circuitId, int rendererId, int componentId)
|
||||
{
|
||||
CircuitId = circuitId;
|
||||
RendererId = rendererId;
|
||||
ComponentId = componentId;
|
||||
}
|
||||
|
||||
public string CircuitId { get; }
|
||||
|
||||
public int RendererId { get; }
|
||||
|
||||
public int ComponentId { get; }
|
||||
}
|
||||
|
||||
private class PrerenderingCancellationStatus
|
||||
{
|
||||
public bool Canceled { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -81,6 +81,15 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
}
|
||||
}
|
||||
|
||||
public void PermanentDisconnect(CircuitHost circuitHost)
|
||||
{
|
||||
if (ConnectedCircuits.TryRemove(circuitHost.CircuitId, out _))
|
||||
{
|
||||
Log.CircuitDisconnectedPermanently(_logger, circuitHost.CircuitId);
|
||||
circuitHost.Client.SetDisconnected();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual Task DisconnectAsync(CircuitHost circuitHost, string connectionId)
|
||||
{
|
||||
Log.CircuitDisconnectStarted(_logger, circuitHost.CircuitId, connectionId);
|
||||
|
|
@ -314,6 +323,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
private static readonly Action<ILogger, string, Exception> _circuitNotActive;
|
||||
private static readonly Action<ILogger, string, string, Exception> _circuitConnectedToDifferentConnection;
|
||||
private static readonly Action<ILogger, string, Exception> _circuitMarkedDisconnected;
|
||||
private static readonly Action<ILogger, string, Exception> _circuitDisconnectedPermanently;
|
||||
private static readonly Action<ILogger, string, EvictionReason, Exception> _circuitEvicted;
|
||||
|
||||
private static class EventIds
|
||||
|
|
@ -330,6 +340,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
public static readonly EventId CircuitConnectedToDifferentConnection = new EventId(109, "CircuitConnectedToDifferentConnection");
|
||||
public static readonly EventId CircuitMarkedDisconnected = new EventId(110, "CircuitMarkedDisconnected");
|
||||
public static readonly EventId CircuitEvicted = new EventId(111, "CircuitEvicted");
|
||||
public static readonly EventId CircuitDisconnectedPermanently = new EventId(112, "CircuitDisconnectedPermanently");
|
||||
}
|
||||
|
||||
static Log()
|
||||
|
|
@ -394,6 +405,11 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
EventIds.CircuitMarkedDisconnected,
|
||||
"Circuit with id {CircuitId} is disconnected.");
|
||||
|
||||
_circuitDisconnectedPermanently = LoggerMessage.Define<string>(
|
||||
LogLevel.Debug,
|
||||
EventIds.CircuitDisconnectedPermanently,
|
||||
"Circuit with id {CircuitId} has been removed from the registry for permanent disconnection.");
|
||||
|
||||
_circuitEvicted = LoggerMessage.Define<string, EvictionReason>(
|
||||
LogLevel.Debug,
|
||||
EventIds.CircuitEvicted,
|
||||
|
|
@ -436,6 +452,9 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
public static void CircuitMarkedDisconnected(ILogger logger, string circuitId) =>
|
||||
_circuitMarkedDisconnected(logger, circuitId, null);
|
||||
|
||||
public static void CircuitDisconnectedPermanently(ILogger logger, string circuitId) =>
|
||||
_circuitDisconnectedPermanently(logger, circuitId, null);
|
||||
|
||||
public static void CircuitEvicted(ILogger logger, string circuitId, EvictionReason evictionReason) =>
|
||||
_circuitEvicted(logger, circuitId, evictionReason, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Http.Features;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.JSInterop;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||
{
|
||||
|
|
@ -38,10 +39,12 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
public override CircuitHost CreateCircuitHost(
|
||||
HttpContext httpContext,
|
||||
CircuitClientProxy client,
|
||||
string uriAbsolute,
|
||||
string baseUriAbsolute,
|
||||
string baseUri,
|
||||
string uri,
|
||||
ClaimsPrincipal user)
|
||||
{
|
||||
// We do as much intialization as possible eagerly in this method, which makes the error handling
|
||||
// story much simpler. If we throw from here, it's handled inside the initial hub method.
|
||||
var components = ResolveComponentMetadata(httpContext, client);
|
||||
|
||||
var scope = _scopeFactory.CreateScope();
|
||||
|
|
@ -51,20 +54,25 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
jsRuntime.Initialize(client);
|
||||
componentContext.Initialize(client);
|
||||
|
||||
var uriHelper = (RemoteUriHelper)scope.ServiceProvider.GetRequiredService<IUriHelper>();
|
||||
var authenticationStateProvider = scope.ServiceProvider.GetService<AuthenticationStateProvider>() as IHostEnvironmentAuthenticationStateProvider;
|
||||
if (authenticationStateProvider != null)
|
||||
{
|
||||
var authenticationState = new AuthenticationState(httpContext.User); // TODO: Get this from the hub connection context instead
|
||||
authenticationStateProvider.SetAuthenticationState(Task.FromResult(authenticationState));
|
||||
}
|
||||
|
||||
var navigationManager = (RemoteNavigationManager)scope.ServiceProvider.GetRequiredService<NavigationManager>();
|
||||
var navigationInterception = (RemoteNavigationInterception)scope.ServiceProvider.GetRequiredService<INavigationInterception>();
|
||||
if (client.Connected)
|
||||
{
|
||||
uriHelper.AttachJsRuntime(jsRuntime);
|
||||
uriHelper.InitializeState(
|
||||
uriAbsolute,
|
||||
baseUriAbsolute);
|
||||
navigationManager.AttachJsRuntime(jsRuntime);
|
||||
navigationManager.Initialize(baseUri, uri);
|
||||
|
||||
navigationInterception.AttachJSRuntime(jsRuntime);
|
||||
}
|
||||
else
|
||||
{
|
||||
uriHelper.InitializeState(uriAbsolute, baseUriAbsolute);
|
||||
navigationManager.Initialize(baseUri, uri);
|
||||
}
|
||||
|
||||
var rendererRegistry = new RendererRegistry();
|
||||
|
|
@ -100,7 +108,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
return circuitHost;
|
||||
}
|
||||
|
||||
internal static IList<ComponentDescriptor> ResolveComponentMetadata(HttpContext httpContext, CircuitClientProxy client)
|
||||
internal static List<ComponentDescriptor> ResolveComponentMetadata(HttpContext httpContext, CircuitClientProxy client)
|
||||
{
|
||||
if (!client.Connected)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.JSInterop;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserUriHelperInterop;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserNavigationManagerInterop;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,26 +2,26 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.JSInterop;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserUriHelperInterop;
|
||||
using Interop = Microsoft.AspNetCore.Components.Web.BrowserNavigationManagerInterop;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||
{
|
||||
/// <summary>
|
||||
/// A Server-Side Components implementation of <see cref="IUriHelper"/>.
|
||||
/// A Server-Side Blazor implementation of <see cref="NavigationManager"/>.
|
||||
/// </summary>
|
||||
public class RemoteUriHelper : UriHelperBase
|
||||
internal class RemoteNavigationManager : NavigationManager, IHostEnvironmentNavigationManager
|
||||
{
|
||||
private readonly ILogger<RemoteUriHelper> _logger;
|
||||
private readonly ILogger<RemoteNavigationManager> _logger;
|
||||
private IJSRuntime _jsRuntime;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="RemoteUriHelper"/> instance.
|
||||
/// Creates a new <see cref="RemoteNavigationManager"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="logger">The <see cref="ILogger{TCategoryName}"/>.</param>
|
||||
public RemoteUriHelper(ILogger<RemoteUriHelper> logger)
|
||||
public RemoteNavigationManager(ILogger<RemoteNavigationManager> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
|
@ -32,21 +32,21 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
public bool HasAttachedJSRuntime => _jsRuntime != null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="RemoteUriHelper"/>.
|
||||
/// Initializes the <see cref="NavigationManager" />.
|
||||
/// </summary>
|
||||
/// <param name="uriAbsolute">The absolute URI of the current page.</param>
|
||||
/// <param name="baseUriAbsolute">The absolute base URI of the current page.</param>
|
||||
public override void InitializeState(string uriAbsolute, string baseUriAbsolute)
|
||||
/// <param name="baseUri">The base URI.</param>
|
||||
/// <param name="uri">The absolute URI.</param>
|
||||
public new void Initialize(string baseUri, string uri)
|
||||
{
|
||||
base.InitializeState(uriAbsolute, baseUriAbsolute);
|
||||
TriggerOnLocationChanged(isinterceptedLink: false);
|
||||
base.Initialize(baseUri, uri);
|
||||
NotifyLocationChanged(isInterceptedLink: false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="RemoteUriHelper"/>.
|
||||
/// Initializes the <see cref="RemoteNavigationManager"/>.
|
||||
/// </summary>
|
||||
/// <param name="jsRuntime">The <see cref="IJSRuntime"/> to use for interoperability.</param>
|
||||
internal void AttachJsRuntime(IJSRuntime jsRuntime)
|
||||
public void AttachJsRuntime(IJSRuntime jsRuntime)
|
||||
{
|
||||
if (_jsRuntime != null)
|
||||
{
|
||||
|
|
@ -54,31 +54,14 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
}
|
||||
|
||||
_jsRuntime = jsRuntime;
|
||||
|
||||
_jsRuntime.InvokeAsync<object>(
|
||||
Interop.ListenForNavigationEvents,
|
||||
typeof(RemoteUriHelper).Assembly.GetName().Name,
|
||||
nameof(NotifyLocationChanged));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For framework use only.
|
||||
/// </summary>
|
||||
[JSInvokable(nameof(NotifyLocationChanged))]
|
||||
public static void NotifyLocationChanged(string uriAbsolute, bool isInterceptedLink)
|
||||
public void NotifyLocationChanged(string uri, bool intercepted)
|
||||
{
|
||||
var circuit = CircuitHost.Current;
|
||||
if (circuit == null)
|
||||
{
|
||||
var message = $"{nameof(NotifyLocationChanged)} called without a circuit.";
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
Log.ReceivedLocationChangedNotification(_logger, uri, intercepted);
|
||||
|
||||
var uriHelper = (RemoteUriHelper)circuit.Services.GetRequiredService<IUriHelper>();
|
||||
Log.ReceivedLocationChangedNotification(uriHelper._logger, uriAbsolute, isInterceptedLink);
|
||||
|
||||
uriHelper.SetAbsoluteUri(uriAbsolute);
|
||||
uriHelper.TriggerOnLocationChanged(isInterceptedLink);
|
||||
Uri = uri;
|
||||
NotifyLocationChanged(intercepted);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Threading;
|
||||
|
|
@ -10,6 +11,7 @@ using System.Threading.Tasks;
|
|||
using Microsoft.AspNetCore.Components.Rendering;
|
||||
using Microsoft.AspNetCore.Components.Server.Circuits;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.Internal;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
|
|
@ -138,7 +140,8 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
|
|||
pendingRender = new UnacknowledgedRenderBatch(
|
||||
renderId,
|
||||
arrayBuilder,
|
||||
new TaskCompletionSource<object>());
|
||||
new TaskCompletionSource<object>(),
|
||||
ValueStopwatch.StartNew());
|
||||
|
||||
// Buffer the rendered batches no matter what. We'll send it down immediately when the client
|
||||
// is connected or right after the client reconnects.
|
||||
|
|
@ -256,13 +259,14 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
|
|||
|
||||
private void ProcessPendingBatch(string errorMessageOrNull, UnacknowledgedRenderBatch entry)
|
||||
{
|
||||
var elapsedTime = entry.ValueStopwatch.GetElapsedTime();
|
||||
if (errorMessageOrNull == null)
|
||||
{
|
||||
Log.CompletingBatchWithoutError(_logger, entry.BatchId);
|
||||
Log.CompletingBatchWithoutError(_logger, entry.BatchId, elapsedTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.CompletingBatchWithError(_logger, entry.BatchId, errorMessageOrNull);
|
||||
Log.CompletingBatchWithError(_logger, entry.BatchId, errorMessageOrNull, elapsedTime);
|
||||
}
|
||||
|
||||
entry.Data.Dispose();
|
||||
|
|
@ -283,16 +287,18 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
|
|||
|
||||
internal readonly struct UnacknowledgedRenderBatch
|
||||
{
|
||||
public UnacknowledgedRenderBatch(long batchId, ArrayBuilder<byte> data, TaskCompletionSource<object> completionSource)
|
||||
public UnacknowledgedRenderBatch(long batchId, ArrayBuilder<byte> data, TaskCompletionSource<object> completionSource, ValueStopwatch valueStopwatch)
|
||||
{
|
||||
BatchId = batchId;
|
||||
Data = data;
|
||||
CompletionSource = completionSource;
|
||||
ValueStopwatch = valueStopwatch;
|
||||
}
|
||||
|
||||
public long BatchId { get; }
|
||||
public ArrayBuilder<byte> Data { get; }
|
||||
public TaskCompletionSource<object> CompletionSource { get; }
|
||||
public ValueStopwatch ValueStopwatch { get; }
|
||||
}
|
||||
|
||||
private void CaptureAsyncExceptions(Task task)
|
||||
|
|
@ -312,8 +318,8 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
|
|||
private static readonly Action<ILogger, long, int, string, Exception> _beginUpdateDisplayAsync;
|
||||
private static readonly Action<ILogger, string, Exception> _bufferingRenderDisconnectedClient;
|
||||
private static readonly Action<ILogger, string, Exception> _sendBatchDataFailed;
|
||||
private static readonly Action<ILogger, long, string, Exception> _completingBatchWithError;
|
||||
private static readonly Action<ILogger, long, Exception> _completingBatchWithoutError;
|
||||
private static readonly Action<ILogger, long, string, double, Exception> _completingBatchWithError;
|
||||
private static readonly Action<ILogger, long, double, Exception> _completingBatchWithoutError;
|
||||
private static readonly Action<ILogger, long, Exception> _receivedDuplicateBatchAcknowledgement;
|
||||
|
||||
private static class EventIds
|
||||
|
|
@ -349,15 +355,15 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
|
|||
EventIds.SendBatchDataFailed,
|
||||
"Sending data for batch failed: {Message}");
|
||||
|
||||
_completingBatchWithError = LoggerMessage.Define<long, string>(
|
||||
_completingBatchWithError = LoggerMessage.Define<long, string, double>(
|
||||
LogLevel.Debug,
|
||||
EventIds.CompletingBatchWithError,
|
||||
"Completing batch {BatchId} with error: {ErrorMessage}");
|
||||
"Completing batch {BatchId} with error: {ErrorMessage} in {ElapsedMilliseconds}ms.");
|
||||
|
||||
_completingBatchWithoutError = LoggerMessage.Define<long>(
|
||||
_completingBatchWithoutError = LoggerMessage.Define<long, double>(
|
||||
LogLevel.Debug,
|
||||
EventIds.CompletingBatchWithoutError,
|
||||
"Completing batch {BatchId} without error");
|
||||
"Completing batch {BatchId} without error in {ElapsedMilliseconds}ms.");
|
||||
|
||||
_receivedDuplicateBatchAcknowledgement = LoggerMessage.Define<long>(
|
||||
LogLevel.Debug,
|
||||
|
|
@ -396,20 +402,22 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
|
|||
null);
|
||||
}
|
||||
|
||||
public static void CompletingBatchWithError(ILogger logger, long batchId, string errorMessage)
|
||||
public static void CompletingBatchWithError(ILogger logger, long batchId, string errorMessage, TimeSpan elapsedTime)
|
||||
{
|
||||
_completingBatchWithError(
|
||||
logger,
|
||||
batchId,
|
||||
errorMessage,
|
||||
elapsedTime.TotalMilliseconds,
|
||||
null);
|
||||
}
|
||||
|
||||
public static void CompletingBatchWithoutError(ILogger logger, long batchId)
|
||||
public static void CompletingBatchWithoutError(ILogger logger, long batchId, TimeSpan elapsedTime)
|
||||
{
|
||||
_completingBatchWithoutError(
|
||||
logger,
|
||||
batchId,
|
||||
elapsedTime.TotalMilliseconds,
|
||||
null);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,13 +11,10 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
|
||||
public string Selector { get; set; }
|
||||
|
||||
public bool Prerendered { get; set; }
|
||||
|
||||
public void Deconstruct(out Type componentType, out string selector, out bool prerendered)
|
||||
public void Deconstruct(out Type componentType, out string selector)
|
||||
{
|
||||
componentType = ComponentType;
|
||||
selector = Selector;
|
||||
prerendered = Prerendered;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,6 +48,9 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
/// <summary>
|
||||
/// For unit testing only.
|
||||
/// </summary>
|
||||
// We store the circuit host in Context.Items which is tied to the lifetime of the underlying
|
||||
// SignalR connection. There's no need to clean this up, it's a non-owning reference and it
|
||||
// will go away when the connection does.
|
||||
internal CircuitHost CircuitHost
|
||||
{
|
||||
get => (CircuitHost)Context.Items[CircuitKey];
|
||||
|
|
@ -65,14 +68,40 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
CircuitHost = null;
|
||||
return _circuitRegistry.DisconnectAsync(circuitHost, Context.ConnectionId);
|
||||
if (exception != null)
|
||||
{
|
||||
return _circuitRegistry.DisconnectAsync(circuitHost, Context.ConnectionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The client will gracefully disconnect when using websockets by correctly closing the TCP connection.
|
||||
// This happens when the user closes a tab, navigates away from the page or reloads the page.
|
||||
// In these situations we know the user is done with the circuit, so we can get rid of it at that point.
|
||||
// This is important to be able to more efficiently manage resources, specially memory.
|
||||
return TerminateCircuitGracefully(circuitHost);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task TerminateCircuitGracefully(CircuitHost circuitHost)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.CircuitTerminatedGracefully(_logger, circuitHost.CircuitId);
|
||||
_circuitRegistry.PermanentDisconnect(circuitHost);
|
||||
await circuitHost.DisposeAsync();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.UnhandledExceptionInCircuit(_logger, circuitHost.CircuitId, e);
|
||||
}
|
||||
|
||||
await _circuitRegistry.DisconnectAsync(circuitHost, Context.ConnectionId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Intended for framework use only. Applications should not call this method directly.
|
||||
/// </summary>
|
||||
public string StartCircuit(string uriAbsolute, string baseUriAbsolute)
|
||||
public string StartCircuit(string baseUri, string uri)
|
||||
{
|
||||
if (CircuitHost != null)
|
||||
{
|
||||
|
|
@ -81,6 +110,18 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
return null;
|
||||
}
|
||||
|
||||
if (baseUri == null ||
|
||||
uri == null ||
|
||||
!Uri.IsWellFormedUriString(baseUri, UriKind.Absolute) ||
|
||||
!Uri.IsWellFormedUriString(uri, UriKind.Absolute))
|
||||
{
|
||||
// We do some really minimal validation here to prevent obviously wrong data from getting in
|
||||
// without duplicating too much logic.
|
||||
Log.InvalidInputData(_logger);
|
||||
_ = NotifyClientError(Clients.Caller, $"The uris provided are invalid.");
|
||||
return null;
|
||||
}
|
||||
|
||||
var circuitClient = new CircuitClientProxy(Clients.Caller, Context.ConnectionId);
|
||||
if (DefaultCircuitFactory.ResolveComponentMetadata(Context.GetHttpContext(), circuitClient).Count == 0)
|
||||
{
|
||||
|
|
@ -93,26 +134,35 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
return null;
|
||||
}
|
||||
|
||||
var circuitHost = _circuitFactory.CreateCircuitHost(
|
||||
Context.GetHttpContext(),
|
||||
circuitClient,
|
||||
uriAbsolute,
|
||||
baseUriAbsolute,
|
||||
Context.User);
|
||||
try
|
||||
{
|
||||
var circuitHost = _circuitFactory.CreateCircuitHost(
|
||||
Context.GetHttpContext(),
|
||||
circuitClient,
|
||||
baseUri,
|
||||
uri,
|
||||
Context.User);
|
||||
|
||||
circuitHost.UnhandledException += CircuitHost_UnhandledException;
|
||||
circuitHost.UnhandledException += CircuitHost_UnhandledException;
|
||||
|
||||
// Fire-and-forget the initialization process, because we can't block the
|
||||
// SignalR message loop (we'd get a deadlock if any of the initialization
|
||||
// logic relied on receiving a subsequent message from SignalR), and it will
|
||||
// take care of its own errors anyway.
|
||||
_ = circuitHost.InitializeAsync(Context.ConnectionAborted);
|
||||
// Fire-and-forget the initialization process, because we can't block the
|
||||
// SignalR message loop (we'd get a deadlock if any of the initialization
|
||||
// logic relied on receiving a subsequent message from SignalR), and it will
|
||||
// take care of its own errors anyway.
|
||||
_ = circuitHost.InitializeAsync(Context.ConnectionAborted);
|
||||
|
||||
_circuitRegistry.Register(circuitHost);
|
||||
|
||||
CircuitHost = circuitHost;
|
||||
|
||||
return circuitHost.CircuitId;
|
||||
// It's safe to *publish* the circuit now because nothing will be able
|
||||
// to run inside it until after InitializeAsync completes.
|
||||
_circuitRegistry.Register(circuitHost);
|
||||
CircuitHost = circuitHost;
|
||||
return circuitHost.CircuitId;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.CircuitInitializationFailed(_logger, ex);
|
||||
NotifyClientError(Clients.Caller, "The circuit failed to initialize.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -124,8 +174,8 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
if (circuitHost != null)
|
||||
{
|
||||
CircuitHost = circuitHost;
|
||||
CircuitHost.UnhandledException += CircuitHost_UnhandledException;
|
||||
|
||||
circuitHost.InitializeCircuitAfterPrerender(CircuitHost_UnhandledException);
|
||||
circuitHost.SetCircuitUser(Context.User);
|
||||
circuitHost.SendPendingBatches();
|
||||
return true;
|
||||
|
|
@ -195,6 +245,18 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
CircuitHost.Renderer.OnRenderCompleted(renderId, errorMessageOrNull);
|
||||
}
|
||||
|
||||
public void OnLocationChanged(string uri, bool intercepted)
|
||||
{
|
||||
if (CircuitHost == null)
|
||||
{
|
||||
Log.CircuitHostNotInitialized(_logger);
|
||||
NotifyClientError(Clients.Caller, "Circuit not initialized.");
|
||||
return;
|
||||
}
|
||||
|
||||
_ = CircuitHost.OnLocationChangedAsync(uri, intercepted);
|
||||
}
|
||||
|
||||
private async void CircuitHost_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
var circuitHost = (CircuitHost)sender;
|
||||
|
|
@ -246,8 +308,16 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(5, "CircuitAlreadyInitialized"), "The circuit host '{CircuitId}' has already been initialized");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _circuitHostNotInitialized =
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(6, "CircuitHostNotInitialized"), "Call to '{CallSite}' received before the circuit host initialization.");
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(6, "CircuitHostNotInitialized"), "Call to '{CallSite}' received before the circuit host initialization");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _circuitTerminatedGracefully =
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(7, "CircuitTerminatedGracefully"), "Circuit '{CircuitId}' terminated gracefully");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _invalidInputData =
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(8, "InvalidInputData"), "Call to '{CallSite}' received invalid input data");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _circuitInitializationFailed =
|
||||
LoggerMessage.Define(LogLevel.Debug, new EventId(9, "CircuitInitializationFailed"), "Circuit initialization failed");
|
||||
|
||||
public static void NoComponentsRegisteredInEndpoint(ILogger logger, string endpointDisplayName)
|
||||
{
|
||||
|
|
@ -272,6 +342,12 @@ namespace Microsoft.AspNetCore.Components.Server
|
|||
public static void CircuitAlreadyInitialized(ILogger logger, string circuitId) => _circuitAlreadyInitialized(logger, circuitId, null);
|
||||
|
||||
public static void CircuitHostNotInitialized(ILogger logger, [CallerMemberName] string callSite = "") => _circuitHostNotInitialized(logger, callSite, null);
|
||||
|
||||
public static void CircuitTerminatedGracefully(ILogger logger, string circuitId) => _circuitTerminatedGracefully(logger, circuitId, null);
|
||||
|
||||
public static void InvalidInputData(ILogger logger, [CallerMemberName] string callSite = "") => _invalidInputData(logger, callSite, null);
|
||||
|
||||
public static void CircuitInitializationFailed(ILogger logger, Exception exception) => _circuitInitializationFailed(logger, exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,16 +63,10 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
|
||||
services.TryAddSingleton<CircuitRegistry>();
|
||||
|
||||
// We explicitly take over the prerendering and components services here.
|
||||
// We can't have two separate component implementations coexisting at the
|
||||
// same time, so when you register components (Circuits) it takes over
|
||||
// all the abstractions.
|
||||
services.AddScoped<IComponentPrerenderer, CircuitPrerenderer>();
|
||||
|
||||
// Standard razor component services implementations
|
||||
// Standard blazor hosting services implementations
|
||||
//
|
||||
// These intentionally replace the non-interactive versions included in MVC.
|
||||
services.AddScoped<IUriHelper, RemoteUriHelper>();
|
||||
services.AddScoped<NavigationManager, RemoteNavigationManager>();
|
||||
services.AddScoped<IJSRuntime, RemoteJSRuntime>();
|
||||
services.AddScoped<INavigationInterception, RemoteNavigationInterception>();
|
||||
services.AddScoped<IComponentContext, RemoteComponentContext>();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
|
|
@ -14,12 +14,13 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AspNetCore.Components.Web" />
|
||||
<Reference Include="Microsoft.AspNetCore.DataProtection" />
|
||||
<Reference Include="Microsoft.Extensions.Logging" />
|
||||
<Reference Include="Microsoft.AspNetCore.SignalR" />
|
||||
<Reference Include="Microsoft.AspNetCore.StaticFiles" />
|
||||
<Reference Include="Microsoft.Extensions.Caching.Memory" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Composite" />
|
||||
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
|
||||
<Reference Include="Microsoft.Extensions.Logging" />
|
||||
<Reference Include="Microsoft.Extensions.ValueStopwatch.Sources" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -1,33 +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 System.IO;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of a prerendering an <see cref="IComponent"/>.
|
||||
/// </summary>
|
||||
public sealed class ComponentPrerenderResult
|
||||
{
|
||||
private readonly IEnumerable<string> _result;
|
||||
|
||||
internal ComponentPrerenderResult(IEnumerable<string> result)
|
||||
{
|
||||
_result = result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the prerendering result to the given <paramref name="writer"/>.
|
||||
/// </summary>
|
||||
/// <param name="writer">The <see cref="TextWriter"/> the results will be written to.</param>
|
||||
public void WriteTo(TextWriter writer)
|
||||
{
|
||||
foreach (var element in _result)
|
||||
{
|
||||
writer.Write(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +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;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// The context for prerendering a component.
|
||||
/// </summary>
|
||||
public class ComponentPrerenderingContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the component type.
|
||||
/// </summary>
|
||||
public Type ComponentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameters for the component.
|
||||
/// </summary>
|
||||
public ParameterView Parameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="HttpContext"/> in which the prerendering has been initiated.
|
||||
/// </summary>
|
||||
public HttpContext Context { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +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.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// Prerrenders <see cref="IComponent"/> instances.
|
||||
/// </summary>
|
||||
public interface IComponentPrerenderer
|
||||
{
|
||||
/// <summary>
|
||||
/// Prerrenders the component <see cref="ComponentPrerenderingContext.ComponentType"/>.
|
||||
/// </summary>
|
||||
/// <param name="context">The context in which the prerrendering is happening.</param>
|
||||
/// <returns><see cref="Task{TResult}"/> that will complete when the prerendering is done.</returns>
|
||||
Task<ComponentPrerenderResult> PrerenderComponentAsync(ComponentPrerenderingContext context);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,253 +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;
|
||||
using System.IO;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components.Server.Circuits;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Components.Server.Tests.Circuits
|
||||
{
|
||||
public class CircuitPrerendererTest
|
||||
{
|
||||
private static readonly Regex ContentWrapperRegex = new Regex(
|
||||
"<!-- M.A.C.Component: {\"circuitId\":\"[^\"]+\",\"rendererId\":0,\"componentId\":0} -->(?<content>.*)<!-- M.A.C.Component: 0 -->",
|
||||
RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1)); // Treat the entire input string as a single line
|
||||
|
||||
private static readonly Regex CircuitInfoRegex = new Regex(
|
||||
"<!-- M.A.C.Component: (?<info>.*?) -->.*",
|
||||
RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1)); // Treat the entire input string as a single line
|
||||
|
||||
// Because CircuitPrerenderer is a point of integration with HttpContext,
|
||||
// it's not a good candidate for unit testing. The majority of prerendering
|
||||
// unit tests should be elsewhere in HtmlRendererTests inside the
|
||||
// Microsoft.AspNetCore.Components.Tests projects.
|
||||
//
|
||||
// The only unit tests added here should specifically be about how we're
|
||||
// interacting with the HttpContext for configuring the prerenderer.
|
||||
|
||||
[Fact]
|
||||
public async Task ExtractsUriFromHttpContext_EmptyPathBase()
|
||||
{
|
||||
// Arrange
|
||||
var circuitFactory = new TestCircuitFactory();
|
||||
var circuitRegistry = new CircuitRegistry(
|
||||
Options.Create(new CircuitOptions()),
|
||||
Mock.Of<ILogger<CircuitRegistry>>(),
|
||||
TestCircuitIdFactory.CreateTestFactory());
|
||||
var circuitPrerenderer = new CircuitPrerenderer(circuitFactory, circuitRegistry);
|
||||
var httpContext = new DefaultHttpContext();
|
||||
var httpRequest = httpContext.Request;
|
||||
httpRequest.Scheme = "https";
|
||||
httpRequest.Host = new HostString("example.com", 1234);
|
||||
httpRequest.Path = "/some/path";
|
||||
|
||||
var prerenderingContext = new ComponentPrerenderingContext
|
||||
{
|
||||
ComponentType = typeof(UriDisplayComponent),
|
||||
Parameters = ParameterView.Empty,
|
||||
Context = httpContext
|
||||
};
|
||||
|
||||
// Act
|
||||
var result = await circuitPrerenderer.PrerenderComponentAsync(prerenderingContext);
|
||||
// Assert
|
||||
Assert.Equal(string.Join("", new[]
|
||||
{
|
||||
"The current URI is ",
|
||||
"https://example.com:1234/some/path",
|
||||
" within base URI ",
|
||||
"https://example.com:1234/"
|
||||
}), GetUnwrappedContent(result));
|
||||
}
|
||||
|
||||
private string GetUnwrappedContent(ComponentPrerenderResult rawResult)
|
||||
{
|
||||
var writer = new StringWriter();
|
||||
rawResult.WriteTo(writer);
|
||||
return ContentWrapperRegex.Match(writer.ToString())
|
||||
.Groups["content"].Value
|
||||
.Replace("\r\n","\n");
|
||||
}
|
||||
|
||||
private JsonDocument GetUnwrappedCircuitInfo(ComponentPrerenderResult rawResult)
|
||||
{
|
||||
var writer = new StringWriter();
|
||||
rawResult.WriteTo(writer);
|
||||
var circuitInfo = CircuitInfoRegex.Match(writer.ToString()).Groups["info"].Value;
|
||||
|
||||
return JsonDocument.Parse(circuitInfo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExtractsUriFromHttpContext_NonemptyPathBase()
|
||||
{
|
||||
// Arrange
|
||||
var circuitFactory = new TestCircuitFactory();
|
||||
var circuitRegistry = new CircuitRegistry(
|
||||
Options.Create(new CircuitOptions()),
|
||||
Mock.Of<ILogger<CircuitRegistry>>(),
|
||||
TestCircuitIdFactory.CreateTestFactory());
|
||||
var circuitPrerenderer = new CircuitPrerenderer(circuitFactory, circuitRegistry);
|
||||
var httpContext = new DefaultHttpContext();
|
||||
var httpRequest = httpContext.Request;
|
||||
httpRequest.Scheme = "https";
|
||||
httpRequest.Host = new HostString("example.com", 1234);
|
||||
httpRequest.PathBase = "/my/dir";
|
||||
httpRequest.Path = "/some/path";
|
||||
|
||||
var prerenderingContext = new ComponentPrerenderingContext
|
||||
{
|
||||
ComponentType = typeof(UriDisplayComponent),
|
||||
Parameters = ParameterView.Empty,
|
||||
Context = httpContext
|
||||
};
|
||||
|
||||
// Act
|
||||
var result = await circuitPrerenderer.PrerenderComponentAsync(prerenderingContext);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(string.Join("", new[]
|
||||
{
|
||||
"The current URI is ",
|
||||
"https://example.com:1234/my/dir/some/path",
|
||||
" within base URI ",
|
||||
"https://example.com:1234/my/dir/"
|
||||
}), GetUnwrappedContent(result));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReplacesDashesWithDots_WhenTheyAppearInPairs()
|
||||
{
|
||||
// Arrange
|
||||
var circuitFactory = new TestCircuitFactory(() => "--1234--");
|
||||
var circuitRegistry = new CircuitRegistry(
|
||||
Options.Create(new CircuitOptions()),
|
||||
Mock.Of<ILogger<CircuitRegistry>>(),
|
||||
TestCircuitIdFactory.CreateTestFactory());
|
||||
var circuitPrerenderer = new CircuitPrerenderer(circuitFactory, circuitRegistry);
|
||||
var httpContext = new DefaultHttpContext();
|
||||
var httpRequest = httpContext.Request;
|
||||
httpRequest.Scheme = "https";
|
||||
httpRequest.Host = new HostString("example.com", 1234);
|
||||
httpRequest.Path = "/some/path";
|
||||
|
||||
var prerenderingContext = new ComponentPrerenderingContext
|
||||
{
|
||||
ComponentType = typeof(UriDisplayComponent),
|
||||
Parameters = ParameterView.Empty,
|
||||
Context = httpContext
|
||||
};
|
||||
|
||||
// Act
|
||||
var result = await circuitPrerenderer.PrerenderComponentAsync(prerenderingContext);
|
||||
|
||||
// Assert
|
||||
Assert.Equal("..1234..", GetUnwrappedCircuitInfo(result).RootElement.GetProperty("circuitId").GetString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DisposesCircuitScopeEvenIfPrerenderingThrows()
|
||||
{
|
||||
// Arrange
|
||||
var circuitFactory = new MockServiceScopeCircuitFactory();
|
||||
var circuitRegistry = new CircuitRegistry(
|
||||
Options.Create(new CircuitOptions()),
|
||||
Mock.Of<ILogger<CircuitRegistry>>(),
|
||||
TestCircuitIdFactory.CreateTestFactory());
|
||||
var httpContext = new DefaultHttpContext();
|
||||
var prerenderer = new CircuitPrerenderer(circuitFactory, circuitRegistry);
|
||||
var prerenderingContext = new ComponentPrerenderingContext
|
||||
{
|
||||
ComponentType = typeof(ThrowExceptionComponent),
|
||||
Parameters = ParameterView.Empty,
|
||||
Context = httpContext
|
||||
};
|
||||
|
||||
// Act
|
||||
await Assert.ThrowsAsync<InvalidTimeZoneException>(async () =>
|
||||
await prerenderer.PrerenderComponentAsync(prerenderingContext));
|
||||
|
||||
// Assert
|
||||
circuitFactory.MockServiceScope.Verify(scope => scope.Dispose(), Times.Once());
|
||||
}
|
||||
|
||||
class TestCircuitFactory : CircuitFactory
|
||||
{
|
||||
private readonly Func<string> _circuitIdFactory;
|
||||
|
||||
public TestCircuitFactory(Func<string> circuitIdFactory = null)
|
||||
{
|
||||
_circuitIdFactory = circuitIdFactory ?? (() => Guid.NewGuid().ToString());
|
||||
}
|
||||
|
||||
public override CircuitHost CreateCircuitHost(HttpContext httpContext, CircuitClientProxy client, string uriAbsolute, string baseUriAbsolute, ClaimsPrincipal user)
|
||||
{
|
||||
var serviceCollection = new ServiceCollection();
|
||||
serviceCollection.AddScoped<IUriHelper>(_ =>
|
||||
{
|
||||
var uriHelper = new RemoteUriHelper(NullLogger<RemoteUriHelper>.Instance);
|
||||
uriHelper.InitializeState(uriAbsolute, baseUriAbsolute);
|
||||
return uriHelper;
|
||||
});
|
||||
var serviceScope = serviceCollection.BuildServiceProvider().CreateScope();
|
||||
return TestCircuitHost.Create(_circuitIdFactory(), serviceScope);
|
||||
}
|
||||
}
|
||||
|
||||
class MockServiceScopeCircuitFactory : CircuitFactory
|
||||
{
|
||||
public Mock<IServiceScope> MockServiceScope { get; }
|
||||
= new Mock<IServiceScope>();
|
||||
|
||||
public override CircuitHost CreateCircuitHost(HttpContext httpContext, CircuitClientProxy client, string uriAbsolute, string baseUriAbsolute, ClaimsPrincipal user)
|
||||
{
|
||||
return TestCircuitHost.Create(Guid.NewGuid().ToString(), MockServiceScope.Object);
|
||||
}
|
||||
}
|
||||
|
||||
class UriDisplayComponent : IComponent
|
||||
{
|
||||
private RenderHandle _renderHandle;
|
||||
|
||||
[Inject] IUriHelper UriHelper { get; set; }
|
||||
|
||||
public void Attach(RenderHandle renderHandle)
|
||||
{
|
||||
_renderHandle = renderHandle;
|
||||
}
|
||||
|
||||
public Task SetParametersAsync(ParameterView parameters)
|
||||
{
|
||||
_renderHandle.Render(builder =>
|
||||
{
|
||||
builder.AddContent(0, "The current URI is ");
|
||||
builder.AddContent(1, UriHelper.GetAbsoluteUri());
|
||||
builder.AddContent(2, " within base URI ");
|
||||
builder.AddContent(3, UriHelper.GetBaseUri());
|
||||
});
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
class ThrowExceptionComponent : IComponent
|
||||
{
|
||||
public void Attach(RenderHandle renderHandle)
|
||||
=> throw new InvalidTimeZoneException();
|
||||
|
||||
public Task SetParametersAsync(ParameterView parameters)
|
||||
=> Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,6 @@ using Microsoft.AspNetCore.SignalR;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.Logging.Testing;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Moq;
|
||||
|
||||
|
|
@ -19,7 +18,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
|||
{
|
||||
internal class TestCircuitHost : CircuitHost
|
||||
{
|
||||
private TestCircuitHost(string circuitId, IServiceScope scope, CircuitClientProxy client, RendererRegistry rendererRegistry, RemoteRenderer renderer, IList<ComponentDescriptor> descriptors, RemoteJSRuntime jsRuntime, CircuitHandler[] circuitHandlers, ILogger logger)
|
||||
private TestCircuitHost(string circuitId, IServiceScope scope, CircuitClientProxy client, RendererRegistry rendererRegistry, RemoteRenderer renderer, IReadOnlyList<ComponentDescriptor> descriptors, RemoteJSRuntime jsRuntime, CircuitHandler[] circuitHandlers, ILogger logger)
|
||||
: base(circuitId, scope, client, rendererRegistry, renderer, descriptors, jsRuntime, circuitHandlers, logger)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Moq;
|
||||
|
|
@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Components.Server.Tests
|
|||
.UseRouting()
|
||||
.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapBlazorHub(dispatchOptions => called = true);
|
||||
endpoints.MapBlazorHub<MyComponent>("app", dispatchOptions => called = true);
|
||||
}).Build();
|
||||
|
||||
// Assert
|
||||
|
|
@ -68,5 +68,18 @@ namespace Microsoft.AspNetCore.Components.Server.Tests
|
|||
|
||||
return new ApplicationBuilder(serviceProvder);
|
||||
}
|
||||
|
||||
private class MyComponent : IComponent
|
||||
{
|
||||
public void Attach(RenderHandle renderHandle)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public Task SetParametersAsync(ParameterView parameters)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace Microsoft.AspNetCore.Components.Test.Helpers
|
|||
Assert.Equal(attributeValue, frame.AttributeValue);
|
||||
}
|
||||
|
||||
public static void Attribute(RenderTreeFrame frame, string attributeName, Action<UIEventArgs> attributeEventHandlerValue, int? sequence = null)
|
||||
public static void Attribute(RenderTreeFrame frame, string attributeName, Action<EventArgs> attributeEventHandlerValue, int? sequence = null)
|
||||
{
|
||||
AssertFrame.Attribute(frame, attributeName, sequence);
|
||||
Assert.Equal(attributeEventHandlerValue, frame.AttributeValue);
|
||||
|
|
|
|||
|
|
@ -60,10 +60,10 @@ namespace Microsoft.AspNetCore.Components.Test.Helpers
|
|||
public new Task RenderRootComponentAsync(int componentId, ParameterView parameters)
|
||||
=> Dispatcher.InvokeAsync(() => base.RenderRootComponentAsync(componentId, parameters));
|
||||
|
||||
public Task DispatchEventAsync(ulong eventHandlerId, UIEventArgs args)
|
||||
public Task DispatchEventAsync(ulong eventHandlerId, EventArgs args)
|
||||
=> Dispatcher.InvokeAsync(() => base.DispatchEventAsync(eventHandlerId, null, args));
|
||||
|
||||
public new Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, UIEventArgs args)
|
||||
public new Task DispatchEventAsync(ulong eventHandlerId, EventFieldInfo eventFieldInfo, EventArgs args)
|
||||
=> Dispatcher.InvokeAsync(() => base.DispatchEventAsync(eventHandlerId, eventFieldInfo, args));
|
||||
|
||||
private static Task UnwrapTask(Task task)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -6,7 +6,7 @@ import { shouldAutoStart } from './BootCommon';
|
|||
import { RenderQueue } from './Platform/Circuits/RenderQueue';
|
||||
import { ConsoleLogger } from './Platform/Logging/Loggers';
|
||||
import { LogLevel, Logger } from './Platform/Logging/Logger';
|
||||
import { discoverPrerenderedCircuits, startCircuit } from './Platform/Circuits/CircuitManager';
|
||||
import { startCircuit } from './Platform/Circuits/CircuitManager';
|
||||
import { setEventDispatcher } from './Rendering/RendererEventDispatcher';
|
||||
import { resolveOptions, BlazorOptions } from './Platform/Circuits/BlazorOptions';
|
||||
import { DefaultReconnectionHandler } from './Platform/Circuits/DefaultReconnectionHandler';
|
||||
|
|
@ -27,32 +27,18 @@ async function boot(userOptions?: Partial<BlazorOptions>): Promise<void> {
|
|||
options.reconnectionHandler = options.reconnectionHandler || window['Blazor'].defaultReconnectionHandler;
|
||||
logger.log(LogLevel.Information, 'Starting up blazor server-side application.');
|
||||
|
||||
// Initialize statefully prerendered circuits and their components
|
||||
// Note: This will all be removed soon
|
||||
const initialConnection = await initializeConnection(options, logger);
|
||||
const circuits = discoverPrerenderedCircuits(document);
|
||||
for (let i = 0; i < circuits.length; i++) {
|
||||
const circuit = circuits[i];
|
||||
for (let j = 0; j < circuit.components.length; j++) {
|
||||
const component = circuit.components[j];
|
||||
component.initialize();
|
||||
}
|
||||
}
|
||||
|
||||
const circuit = await startCircuit(initialConnection);
|
||||
if (!circuit) {
|
||||
logger.log(LogLevel.Information, 'No preregistered components to render.');
|
||||
}
|
||||
|
||||
const reconnect = async (existingConnection?: signalR.HubConnection): Promise<boolean> => {
|
||||
if (renderingFailed) {
|
||||
// We can't reconnect after a failure, so exit early.
|
||||
return false;
|
||||
}
|
||||
const reconnection = existingConnection || await initializeConnection(options, logger);
|
||||
const results = await Promise.all(circuits.map(circuit => circuit.reconnect(reconnection)));
|
||||
|
||||
if (reconnectionFailed(results)) {
|
||||
const reconnection = existingConnection || await initializeConnection(options, logger);
|
||||
if (!(await circuit.reconnect(reconnection))) {
|
||||
logger.log(LogLevel.Information, 'Reconnection attempt failed.');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -63,19 +49,7 @@ async function boot(userOptions?: Partial<BlazorOptions>): Promise<void> {
|
|||
|
||||
window['Blazor'].reconnect = reconnect;
|
||||
|
||||
const reconnectTask = reconnect(initialConnection);
|
||||
|
||||
if (circuit) {
|
||||
circuits.push(circuit);
|
||||
}
|
||||
|
||||
await reconnectTask;
|
||||
|
||||
logger.log(LogLevel.Information, 'Blazor server-side application started.');
|
||||
|
||||
function reconnectionFailed(results: boolean[]): boolean {
|
||||
return !results.reduce((current, next) => current && next, true);
|
||||
}
|
||||
}
|
||||
|
||||
async function initializeConnection(options: BlazorOptions, logger: Logger): Promise<signalR.HubConnection> {
|
||||
|
|
@ -94,6 +68,11 @@ async function initializeConnection(options: BlazorOptions, logger: Logger): Pro
|
|||
return connection.send('DispatchBrowserEvent', JSON.stringify(descriptor), JSON.stringify(args));
|
||||
});
|
||||
|
||||
// Configure navigation via SignalR
|
||||
window['Blazor']._internal.navigationManager.listenForNavigationEvents((uri: string, intercepted: boolean): Promise<void> => {
|
||||
return connection.send('OnLocationChanged', uri, intercepted);
|
||||
});
|
||||
|
||||
connection.on('JS.BeginInvokeJS', DotNet.jsCallDispatcher.beginInvokeJSFromDotNet);
|
||||
connection.on('JS.EndInvokeDotNet', (args: string) => DotNet.jsCallDispatcher.endInvokeDotNetFromJS(...(JSON.parse(args) as [string, boolean, unknown])));
|
||||
connection.on('JS.RenderBatch', (browserRendererId: number, batchId: number, batchData: Uint8Array) => {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,16 @@ async function boot(options?: any): Promise<void> {
|
|||
renderBatch(browserRendererId, new SharedMemoryRenderBatch(batchAddress));
|
||||
};
|
||||
|
||||
// Configure navigation via JS Interop
|
||||
window['Blazor']._internal.navigationManager.listenForNavigationEvents(async (uri: string, intercepted: boolean): Promise<void> => {
|
||||
await DotNet.invokeMethodAsync(
|
||||
'Microsoft.AspNetCore.Blazor',
|
||||
'NotifyLocationChanged',
|
||||
uri,
|
||||
intercepted
|
||||
);
|
||||
});
|
||||
|
||||
// Fetch the boot JSON file
|
||||
const bootConfig = await fetchBootConfigAsync();
|
||||
const embeddedResourcesPromise = loadEmbeddedResourcesAsync(bootConfig);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { navigateTo, internalFunctions as uriHelperInternalFunctions } from './Services/UriHelper';
|
||||
import { navigateTo, internalFunctions as navigationManagerInternalFunctions } from './Services/NavigationManager';
|
||||
import { internalFunctions as httpInternalFunctions } from './Services/Http';
|
||||
import { attachRootComponentToElement } from './Rendering/Renderer';
|
||||
|
||||
|
|
@ -9,6 +9,6 @@ window['Blazor'] = {
|
|||
_internal: {
|
||||
attachRootComponentToElement,
|
||||
http: httpInternalFunctions,
|
||||
uriHelper: uriHelperInternalFunctions,
|
||||
navigationManager: navigationManagerInternalFunctions,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
import { internalFunctions as uriHelperFunctions } from '../../Services/UriHelper';
|
||||
import { ComponentDescriptor, MarkupRegistrationTags, StartComponentComment, EndComponentComment } from './ComponentDescriptor';
|
||||
import { internalFunctions as navigationManagerFunctions } from '../../Services/NavigationManager';
|
||||
|
||||
export class CircuitDescriptor {
|
||||
public circuitId: string;
|
||||
|
||||
public components: ComponentDescriptor[];
|
||||
|
||||
public constructor(circuitId: string, components: ComponentDescriptor[]) {
|
||||
public constructor(circuitId: string) {
|
||||
this.circuitId = circuitId;
|
||||
this.components = components;
|
||||
}
|
||||
|
||||
public reconnect(reconnection: signalR.HubConnection): Promise<boolean> {
|
||||
|
|
@ -16,115 +12,11 @@ export class CircuitDescriptor {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
export function discoverPrerenderedCircuits(document: Document): CircuitDescriptor[] {
|
||||
const commentPairs = resolveCommentPairs(document);
|
||||
const discoveredCircuits = new Map<string, ComponentDescriptor[]>();
|
||||
for (let i = 0; i < commentPairs.length; i++) {
|
||||
const pair = commentPairs[i];
|
||||
// We replace '--' on the server with '..' when we prerender due to the fact that this
|
||||
// is not allowed in HTML comments and doesn't get encoded by default.
|
||||
const circuitId = pair.start.circuitId.replace('..', '--');
|
||||
let circuit = discoveredCircuits.get(circuitId);
|
||||
if (!circuit) {
|
||||
circuit = [];
|
||||
discoveredCircuits.set(circuitId, circuit);
|
||||
}
|
||||
const entry = new ComponentDescriptor(pair.start.componentId, circuitId, pair.start.rendererId, pair);
|
||||
circuit.push(entry);
|
||||
}
|
||||
const circuits: CircuitDescriptor[] = [];
|
||||
for (const [key, values] of discoveredCircuits) {
|
||||
circuits.push(new CircuitDescriptor(key, values));
|
||||
}
|
||||
return circuits;
|
||||
}
|
||||
|
||||
export async function startCircuit(connection: signalR.HubConnection): Promise<CircuitDescriptor | undefined> {
|
||||
const result = await connection.invoke<string>('StartCircuit', uriHelperFunctions.getLocationHref(), uriHelperFunctions.getBaseURI());
|
||||
export async function startCircuit(connection: signalR.HubConnection): Promise<CircuitDescriptor> {
|
||||
const result = await connection.invoke<string>('StartCircuit', navigationManagerFunctions.getBaseURI(), navigationManagerFunctions.getLocationHref());
|
||||
if (result) {
|
||||
return new CircuitDescriptor(result, []);
|
||||
return new CircuitDescriptor(result);
|
||||
} else {
|
||||
return undefined;
|
||||
throw new Error('Circuit failed to start');
|
||||
}
|
||||
}
|
||||
|
||||
function resolveCommentPairs(node: Node): MarkupRegistrationTags[] {
|
||||
if (!node.hasChildNodes()) {
|
||||
return [];
|
||||
}
|
||||
const result: MarkupRegistrationTags[] = [];
|
||||
const children = node.childNodes;
|
||||
let i = 0;
|
||||
const childrenLength = children.length;
|
||||
while (i < childrenLength) {
|
||||
const currentChildNode = children[i];
|
||||
const startComponent = getComponentStartComment(currentChildNode);
|
||||
if (!startComponent) {
|
||||
i++;
|
||||
const childResults = resolveCommentPairs(currentChildNode);
|
||||
for (let j = 0; j < childResults.length; j++) {
|
||||
const childResult = childResults[j];
|
||||
result.push(childResult);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
const endComponent = getComponentEndComment(startComponent, children, i + 1, childrenLength);
|
||||
result.push({ start: startComponent, end: endComponent });
|
||||
i = endComponent.index + 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getComponentStartComment(node: Node): StartComponentComment | undefined {
|
||||
if (node.nodeType !== Node.COMMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
if (node.textContent) {
|
||||
const componentStartComment = /\W+M.A.C.Component:[^{]*(.*)$/;
|
||||
const definition = componentStartComment.exec(node.textContent);
|
||||
const json = definition && definition[1];
|
||||
if (json) {
|
||||
try {
|
||||
const { componentId, rendererId, circuitId } = JSON.parse(json);
|
||||
const allComponents = componentId !== undefined && rendererId !== undefined && !!circuitId;
|
||||
if (allComponents) {
|
||||
return {
|
||||
node: node as Comment,
|
||||
circuitId,
|
||||
rendererId: rendererId,
|
||||
componentId: componentId,
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
throw new Error(`Found malformed start component comment at ${node.textContent}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
function getComponentEndComment(component: StartComponentComment, children: NodeList, index: number, end: number): EndComponentComment {
|
||||
for (let i = index; i < end; i++) {
|
||||
const node = children[i];
|
||||
if (node.nodeType !== Node.COMMENT_NODE) {
|
||||
continue;
|
||||
}
|
||||
if (!node.textContent) {
|
||||
continue;
|
||||
}
|
||||
const componentEndComment = /\W+M.A.C.Component:\W+(\d+)\W+$/;
|
||||
const definition = componentEndComment.exec(node.textContent);
|
||||
const json = definition && definition[1];
|
||||
if (!json) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
// The value is expected to be a JSON encoded number
|
||||
const componentId = JSON.parse(json);
|
||||
if (componentId === component.componentId) {
|
||||
return { componentId, node: node as Comment, index: i };
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
throw new Error(`Found malformed end component comment at ${node.textContent}`);
|
||||
}
|
||||
throw new Error(`End component comment not found for ${component.node}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
import { attachRootComponentToLogicalElement } from '../../Rendering/Renderer';
|
||||
import { toLogicalRootCommentElement } from '../../Rendering/LogicalElements';
|
||||
|
||||
export interface EndComponentComment {
|
||||
componentId: number;
|
||||
node: Comment;
|
||||
index: number;
|
||||
}
|
||||
|
||||
export interface StartComponentComment {
|
||||
node: Comment;
|
||||
rendererId: number;
|
||||
componentId: number;
|
||||
circuitId: string;
|
||||
}
|
||||
|
||||
// Represent pairs of start end comments indicating a component that was registered
|
||||
// in markup (such as a prerendered component)
|
||||
export interface MarkupRegistrationTags {
|
||||
start: StartComponentComment;
|
||||
end: EndComponentComment;
|
||||
}
|
||||
|
||||
export class ComponentDescriptor {
|
||||
public registrationTags: MarkupRegistrationTags;
|
||||
|
||||
public componentId: number;
|
||||
|
||||
public circuitId: string;
|
||||
|
||||
public rendererId: number;
|
||||
|
||||
public constructor(componentId: number, circuitId: string, rendererId: number, descriptor: MarkupRegistrationTags) {
|
||||
this.componentId = componentId;
|
||||
this.circuitId = circuitId;
|
||||
this.rendererId = rendererId;
|
||||
this.registrationTags = descriptor;
|
||||
}
|
||||
|
||||
public initialize(): void {
|
||||
const startEndPair = { start: this.registrationTags.start.node, end: this.registrationTags.end.node };
|
||||
|
||||
const logicalElement = toLogicalRootCommentElement(startEndPair.start, startEndPair.end);
|
||||
attachRootComponentToLogicalElement(this.rendererId, logicalElement, this.componentId);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ let hasRegisteredNavigationInterception = false;
|
|||
let hasRegisteredNavigationEventListeners = false;
|
||||
|
||||
// Will be initialized once someone registers
|
||||
let notifyLocationChangedCallback: { assemblyName: string; functionName: string } | null = null;
|
||||
let notifyLocationChangedCallback: ((uri: string, intercepted: boolean) => Promise<void>) | null = null;
|
||||
|
||||
// These are the functions we're making available for invocation from .NET
|
||||
export const internalFunctions = {
|
||||
|
|
@ -16,12 +16,12 @@ export const internalFunctions = {
|
|||
getLocationHref: () => location.href,
|
||||
};
|
||||
|
||||
function listenForNavigationEvents(assemblyName: string, functionName: string) {
|
||||
function listenForNavigationEvents(callback: (uri: string, intercepted: boolean) => Promise<void>) {
|
||||
if (hasRegisteredNavigationEventListeners) {
|
||||
return;
|
||||
}
|
||||
|
||||
notifyLocationChangedCallback = { assemblyName, functionName };
|
||||
notifyLocationChangedCallback = callback;
|
||||
|
||||
hasRegisteredNavigationEventListeners = true;
|
||||
window.addEventListener('popstate', () => notifyLocationChanged(false));
|
||||
|
|
@ -95,12 +95,7 @@ function performInternalNavigation(absoluteInternalHref: string, interceptedLink
|
|||
|
||||
async function notifyLocationChanged(interceptedLink: boolean) {
|
||||
if (notifyLocationChangedCallback) {
|
||||
await DotNet.invokeMethodAsync(
|
||||
notifyLocationChangedCallback.assemblyName,
|
||||
notifyLocationChangedCallback.functionName,
|
||||
location.href,
|
||||
interceptedLink
|
||||
);
|
||||
await notifyLocationChangedCallback(location.href, interceptedLink);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
(global as any).DotNet = { attachReviver: jest.fn() };
|
||||
|
||||
import { discoverPrerenderedCircuits } from '../src/Platform/Circuits/CircuitManager';
|
||||
import { JSDOM } from 'jsdom';
|
||||
|
||||
describe('CircuitManager', () => {
|
||||
|
||||
it('discoverPrerenderedCircuits returns discovered prerendered circuits', () => {
|
||||
const dom = new JSDOM(`<!doctype HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>Preamble</header>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":1} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 1 -->
|
||||
<footer></footer>
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
const results = discoverPrerenderedCircuits(dom.window.document);
|
||||
|
||||
expect(results.length).toEqual(1);
|
||||
expect(results[0].components.length).toEqual(1);
|
||||
const result = results[0].components[0];
|
||||
expect(result.circuitId).toEqual("1234");
|
||||
expect(result.rendererId).toEqual(2);
|
||||
expect(result.componentId).toEqual(1);
|
||||
|
||||
});
|
||||
|
||||
it('discoverPrerenderedCircuits returns discovers multiple prerendered circuits', () => {
|
||||
const dom = new JSDOM(`<!doctype HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>Preamble</header>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":1} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 1 -->
|
||||
<footer>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":2} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 2 -->
|
||||
</footer>
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
const results = discoverPrerenderedCircuits(dom.window.document);
|
||||
|
||||
expect(results.length).toEqual(1);
|
||||
expect(results[0].components.length).toEqual(2);
|
||||
const first = results[0].components[0];
|
||||
expect(first.circuitId).toEqual("1234");
|
||||
expect(first.rendererId).toEqual(2);
|
||||
expect(first.componentId).toEqual(1);
|
||||
|
||||
const second = results[0].components[1];
|
||||
expect(second.circuitId).toEqual("1234");
|
||||
expect(second.rendererId).toEqual(2);
|
||||
expect(second.componentId).toEqual(2);
|
||||
});
|
||||
|
||||
it('discoverPrerenderedCircuits throws for malformed circuits - improper nesting', () => {
|
||||
const dom = new JSDOM(`<!doctype HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>Preamble</header>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":1} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 2 -->
|
||||
<footer>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":2} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 1 -->
|
||||
</footer>
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
expect(() => discoverPrerenderedCircuits(dom.window.document))
|
||||
.toThrow();
|
||||
});
|
||||
|
||||
|
||||
it('discoverPrerenderedCircuits throws for malformed circuits - mixed string and int', () => {
|
||||
const dom = new JSDOM(`<!doctype HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>Preamble</header>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":"2","componentId":"1"} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 1 -->
|
||||
<footer>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":2} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 2 -->
|
||||
</footer>
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
expect(() => discoverPrerenderedCircuits(dom.window.document))
|
||||
.toThrow();
|
||||
});
|
||||
|
||||
it('discoverPrerenderedCircuits initializes circuits', () => {
|
||||
const dom = new JSDOM(`<!doctype HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>Preamble</header>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":1} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 1 -->
|
||||
<footer>
|
||||
<!-- M.A.C.Component: {"circuitId":"1234","rendererId":2,"componentId":2} -->
|
||||
<p>Prerendered content</p>
|
||||
<!-- M.A.C.Component: 2 -->
|
||||
</footer>
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
const results = discoverPrerenderedCircuits(dom.window.document);
|
||||
|
||||
for (let i = 0; i < results.length; i++) {
|
||||
const result = results[i];
|
||||
for (let j = 0; j < result.components.length; j++) {
|
||||
const component = result.components[j];
|
||||
component.initialize();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
@ -6,7 +6,9 @@ namespace Microsoft.AspNetCore.Components
|
|||
[Microsoft.AspNetCore.Components.BindElementAttribute("select", null, "value", "onchange")]
|
||||
[Microsoft.AspNetCore.Components.BindElementAttribute("textarea", null, "value", "onchange")]
|
||||
[Microsoft.AspNetCore.Components.BindInputElementAttribute("checkbox", null, "checked", "onchange", false, null)]
|
||||
[Microsoft.AspNetCore.Components.BindInputElementAttribute("date", "value", "value", "onchange", true, "yyyy-MM-dd")]
|
||||
[Microsoft.AspNetCore.Components.BindInputElementAttribute("date", null, "value", "onchange", true, "yyyy-MM-dd")]
|
||||
[Microsoft.AspNetCore.Components.BindInputElementAttribute("number", "value", "value", "onchange", true, null)]
|
||||
[Microsoft.AspNetCore.Components.BindInputElementAttribute("number", null, "value", "onchange", true, null)]
|
||||
[Microsoft.AspNetCore.Components.BindInputElementAttribute("text", null, "value", "onchange", false, null)]
|
||||
[Microsoft.AspNetCore.Components.BindInputElementAttribute(null, "value", "value", "onchange", false, null)]
|
||||
|
|
@ -51,23 +53,23 @@ namespace Microsoft.AspNetCore.Components
|
|||
public System.Type EventArgsType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
}
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onabort", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforeactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforecopy", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforecut", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforedeactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforepaste", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onactivate", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforeactivate", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforecopy", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforecut", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforedeactivate", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforepaste", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onblur", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncanplay", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncanplaythrough", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onchange", typeof(Microsoft.AspNetCore.Components.UIChangeEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncanplay", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncanplaythrough", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onchange", typeof(Microsoft.AspNetCore.Components.ChangeEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onclick", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncontextmenu", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncopy", typeof(Microsoft.AspNetCore.Components.UIClipboardEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncuechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncuechange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oncut", typeof(Microsoft.AspNetCore.Components.UIClipboardEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondblclick", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondeactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondeactivate", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondrag", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragend", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragenter", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))]
|
||||
|
|
@ -75,24 +77,24 @@ namespace Microsoft.AspNetCore.Components
|
|||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragover", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragstart", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondrop", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondurationchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onemptied", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onended", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ondurationchange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onemptied", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onended", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onerror", typeof(Microsoft.AspNetCore.Components.UIErrorEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onfocus", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onfocusin", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onfocusout", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onfullscreenchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onfullscreenerror", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onfullscreenchange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onfullscreenerror", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ongotpointercapture", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oninput", typeof(Microsoft.AspNetCore.Components.UIChangeEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oninvalid", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oninput", typeof(Microsoft.AspNetCore.Components.ChangeEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("oninvalid", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onkeydown", typeof(Microsoft.AspNetCore.Components.UIKeyboardEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onkeypress", typeof(Microsoft.AspNetCore.Components.UIKeyboardEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onkeyup", typeof(Microsoft.AspNetCore.Components.UIKeyboardEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onload", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadeddata", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadedmetadata", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadeddata", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadedmetadata", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadend", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadstart", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onlostpointercapture", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
|
|
@ -103,50 +105,51 @@ namespace Microsoft.AspNetCore.Components
|
|||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onmouseup", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onmousewheel", typeof(Microsoft.AspNetCore.Components.UIWheelEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpaste", typeof(Microsoft.AspNetCore.Components.UIClipboardEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpause", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onplay", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onplaying", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpause", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onplay", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onplaying", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointercancel", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerdown", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerenter", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerleave", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerlockchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerlockerror", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerlockchange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerlockerror", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointermove", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerout", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerover", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerup", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onprogress", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onratechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onreadystatechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onreset", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onscroll", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onseeked", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onseeking", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onselect", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onselectionchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onselectstart", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onstalled", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onstop", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onsubmit", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onsuspend", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onratechange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onreadystatechange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onreset", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onscroll", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onseeked", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onseeking", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onselect", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onselectionchange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onselectstart", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onstalled", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onstop", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onsubmit", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onsuspend", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontimeout", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontimeupdate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontimeupdate", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchcancel", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchend", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchenter", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchleave", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchmove", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchstart", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onvolumechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onwaiting", typeof(Microsoft.AspNetCore.Components.UIEventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onvolumechange", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onwaiting", typeof(System.EventArgs))]
|
||||
[Microsoft.AspNetCore.Components.EventHandlerAttribute("onwheel", typeof(Microsoft.AspNetCore.Components.UIWheelEventArgs))]
|
||||
public static partial class EventHandlers
|
||||
{
|
||||
}
|
||||
public partial class UIClipboardEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
public partial class UIClipboardEventArgs : System.EventArgs
|
||||
{
|
||||
public UIClipboardEventArgs() { }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIDataTransferItem
|
||||
{
|
||||
|
|
@ -159,19 +162,21 @@ namespace Microsoft.AspNetCore.Components
|
|||
public UIDragEventArgs() { }
|
||||
public Microsoft.AspNetCore.Components.DataTransfer DataTransfer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIErrorEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
public partial class UIErrorEventArgs : System.EventArgs
|
||||
{
|
||||
public UIErrorEventArgs() { }
|
||||
public int Colno { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public string Filename { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public int Lineno { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public string Message { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIFocusEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
public partial class UIFocusEventArgs : System.EventArgs
|
||||
{
|
||||
public UIFocusEventArgs() { }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIKeyboardEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
public partial class UIKeyboardEventArgs : System.EventArgs
|
||||
{
|
||||
public UIKeyboardEventArgs() { }
|
||||
public bool AltKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
|
|
@ -182,8 +187,9 @@ namespace Microsoft.AspNetCore.Components
|
|||
public bool MetaKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public bool Repeat { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIMouseEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
public partial class UIMouseEventArgs : System.EventArgs
|
||||
{
|
||||
public UIMouseEventArgs() { }
|
||||
public bool AltKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
|
|
@ -197,6 +203,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
public double ScreenX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public double ScreenY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIPointerEventArgs : Microsoft.AspNetCore.Components.UIMouseEventArgs
|
||||
{
|
||||
|
|
@ -210,14 +217,15 @@ namespace Microsoft.AspNetCore.Components
|
|||
public float TiltY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public float Width { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UIProgressEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
public partial class UIProgressEventArgs : System.EventArgs
|
||||
{
|
||||
public UIProgressEventArgs() { }
|
||||
public bool LengthComputable { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public long Loaded { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public long Total { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UITouchEventArgs : Microsoft.AspNetCore.Components.UIEventArgs
|
||||
public partial class UITouchEventArgs : System.EventArgs
|
||||
{
|
||||
public UITouchEventArgs() { }
|
||||
public bool AltKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
|
|
@ -228,6 +236,7 @@ namespace Microsoft.AspNetCore.Components
|
|||
public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.UITouchPoint[] TargetTouches { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Components.UITouchPoint[] Touches { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
}
|
||||
public partial class UITouchPoint
|
||||
{
|
||||
|
|
@ -276,8 +285,8 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
{
|
||||
public static partial class EditContextFieldClassExtensions
|
||||
{
|
||||
public static string FieldClass(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; }
|
||||
public static string FieldClass<TField>(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression<System.Func<TField>> accessor) { throw null; }
|
||||
public static string FieldCssClass(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; }
|
||||
public static string FieldCssClass<TField>(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression<System.Func<TField>> accessor) { throw null; }
|
||||
}
|
||||
public partial class EditForm : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
|
|
@ -308,7 +317,6 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
protected T CurrentValue { get { throw null; } set { } }
|
||||
protected string CurrentValueAsString { get { throw null; } set { } }
|
||||
protected Microsoft.AspNetCore.Components.Forms.EditContext EditContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
protected string FieldClass { get { throw null; } }
|
||||
protected Microsoft.AspNetCore.Components.Forms.FieldIdentifier FieldIdentifier { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public T Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
|
|
@ -372,6 +380,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
[Microsoft.AspNetCore.Components.ParameterAttribute]
|
||||
public System.Linq.Expressions.Expression<System.Func<T>> For { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { }
|
||||
protected virtual void Dispose(bool disposing) { }
|
||||
protected override void OnParametersSet() { }
|
||||
void System.IDisposable.Dispose() { }
|
||||
}
|
||||
|
|
@ -381,6 +390,7 @@ namespace Microsoft.AspNetCore.Components.Forms
|
|||
[Microsoft.AspNetCore.Components.ParameterAttribute(CaptureUnmatchedValues=true)]
|
||||
public System.Collections.Generic.IReadOnlyDictionary<string, object> AdditionalAttributes { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { }
|
||||
protected virtual void Dispose(bool disposing) { }
|
||||
protected override void OnParametersSet() { }
|
||||
void System.IDisposable.Dispose() { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,11 @@ namespace Microsoft.AspNetCore.Components
|
|||
|
||||
// type="number" is invariant culture
|
||||
[BindInputElement("number", null, "value", "onchange", isInvariantCulture: true, format: null)]
|
||||
[BindInputElement("number", "value", "value", "onchange", isInvariantCulture: true, format: null)]
|
||||
|
||||
// type="date" is invariant culture with a specific format
|
||||
[BindInputElement("date", null, "value", "onchange", isInvariantCulture: true, format: "yyyy-MM-dd")]
|
||||
[BindInputElement("date", "value", "value", "onchange", isInvariantCulture: true, format: "yyyy-MM-dd")]
|
||||
|
||||
[BindElement("select", null, "value", "onchange")]
|
||||
[BindElement("textarea", null, "value", "onchange")]
|
||||
|
|
|
|||
|
|
@ -4,11 +4,9 @@
|
|||
namespace Microsoft.AspNetCore.Components.Web
|
||||
{
|
||||
// Shared interop constants
|
||||
internal static class BrowserUriHelperInterop
|
||||
internal static class BrowserNavigationManagerInterop
|
||||
{
|
||||
private static readonly string Prefix = "Blazor._internal.uriHelper.";
|
||||
|
||||
public static readonly string ListenForNavigationEvents = Prefix + "listenForNavigationEvents";
|
||||
private static readonly string Prefix = "Blazor._internal.navigationManager.";
|
||||
|
||||
public static readonly string EnableNavigationInterception = Prefix + "enableNavigationInterception";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue