Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
Updated to ServiceStack v5.12
Browse files Browse the repository at this point in the history
  • Loading branch information
nukedbit committed Aug 19, 2021
1 parent c681519 commit a9ddf6e
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion MyApp.Client/Components/StackBaseComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class StackBaseComponent : ComponentBase
[Inject]
private JsonHttpClient Client {get;set;}

protected async Task<JsonHttpClient> GetClient() {
protected async Task<JsonHttpClient> GetClientAsync() {
var state = await AuthenticationStateTask;
if(state.User is ClaimsPrincipal principal && principal.Identity.IsAuthenticated){
Client.BearerToken = principal.Claims.Where(c => c.Type == "token").FirstOrDefault()?.Value;
Expand Down
12 changes: 6 additions & 6 deletions MyApp.Client/MyApp.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ServiceStack.HttpClient" Version="5.10.5" />
<PackageReference Include="Blazored.LocalStorage" Version="3.0.0" />
<PackageReference Include="Blazor.Extensions.Logging" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.2" PrivateAssets="all" />
<PackageReference Include="ServiceStack.HttpClient" Version="5.12.1" />
<PackageReference Include="Blazored.LocalStorage" Version="4.1.2" />
<PackageReference Include="Blazor.Extensions.Logging" Version="2.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.9" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
<ProjectReference Include="..\MyApp.ServiceModel\MyApp.ServiceModel.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion MyApp.Client/Pages/CallHello.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
private async Task CallHelloService()
{

var client = await GetClient();
var client = await GetClientAsync();
var response = await client.GetAsync(new ServiceModel.Hello() {
Name = "World"
});
Expand Down
2 changes: 1 addition & 1 deletion MyApp.Client/Pages/Counter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
{
currentCount++;

var client = await GetClient();
var client = await GetClientAsync();
}
}
2 changes: 1 addition & 1 deletion MyApp.ServiceInterface/MyApp.ServiceInterface.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceStack" Version="5.10.5" />
<PackageReference Include="ServiceStack" Version="5.12.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion MyApp.ServiceModel/MyApp.ServiceModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceStack.Interfaces" Version="5.10.5" />
<PackageReference Include="ServiceStack.Interfaces" Version="5.12.1" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions MyApp.Tests/MyApp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<ProjectReference Include="..\MyApp.ServiceInterface\MyApp.ServiceInterface.csproj" />
<ProjectReference Include="..\MyApp.ServiceModel\MyApp.ServiceModel.csproj" />

<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="ServiceStack" Version="5.10.5" />
<PackageReference Include="ServiceStack.Kestrel" Version="5.10.5" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="ServiceStack" Version="5.12.1" />
<PackageReference Include="ServiceStack.Kestrel" Version="5.12.1" />
</ItemGroup>

</Project>
21 changes: 11 additions & 10 deletions MyApp.sln
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.3
# Visual Studio Version 17
VisualStudioVersion = 17.0.31606.5
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp", "MyApp\MyApp.csproj", "{5F817400-1A3A-48DF-98A6-E7E5A3DC762F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApp", "MyApp\MyApp.csproj", "{5F817400-1A3A-48DF-98A6-E7E5A3DC762F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp.ServiceInterface", "MyApp.ServiceInterface\MyApp.ServiceInterface.csproj", "{5B8FFF01-1E0B-477D-9D7F-93016C128B23}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApp.ServiceInterface", "MyApp.ServiceInterface\MyApp.ServiceInterface.csproj", "{5B8FFF01-1E0B-477D-9D7F-93016C128B23}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp.ServiceModel", "MyApp.ServiceModel\MyApp.ServiceModel.csproj", "{0127B6CA-1B79-46A6-8307-B36836D107F0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApp.ServiceModel", "MyApp.ServiceModel\MyApp.ServiceModel.csproj", "{0127B6CA-1B79-46A6-8307-B36836D107F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp.Tests", "MyApp.Tests\MyApp.Tests.csproj", "{455EC1EF-134F-4CD4-9C78-E813E4E6D8F6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApp.Tests", "MyApp.Tests\MyApp.Tests.csproj", "{455EC1EF-134F-4CD4-9C78-E813E4E6D8F6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp.Client", "MyApp.Client\MyApp.Client.csproj", "{320C1E1A-F198-420D-88DF-2D929A656551}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApp.Client", "MyApp.Client\MyApp.Client.csproj", "{320C1E1A-F198-420D-88DF-2D929A656551}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{672D91B4-2CE5-43CA-9AEF-66E6884A6E0D}"
ProjectSection(SolutionItems) = preProject
NuGet.Config = NuGet.Config
EndProjectSection
ProjectSection(SolutionItems) = preProject
NuGet.Config = NuGet.Config
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
10 changes: 5 additions & 5 deletions MyApp/MyApp.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
Expand All @@ -8,10 +8,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.2" />
<PackageReference Include="ServiceStack" Version="5.10.5" />
<PackageReference Include="ServiceStack.OrmLite.Sqlite" Version="5.10.5" />
<PackageReference Include="ServiceStack.Server" Version="5.10.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.9" />
<PackageReference Include="ServiceStack" Version="5.12.1" />
<PackageReference Include="ServiceStack.OrmLite.Sqlite" Version="5.12.1" />
<PackageReference Include="ServiceStack.Server" Version="5.12.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Blazor WASM & ServiceStack for .NET 5.0 RTM

This template integrate ServiceStack with Blazor on .NET 5 RTM and [ServiceStack 5.10.1](https://docs.servicestack.net/releases/v5.10).
This template integrate ServiceStack with Blazor on .NET 5 RTM and [ServiceStack 5.12](https://docs.servicestack.net/releases/v5.12).

The blazor wasm app is served through the main ServiceStack web host so you can deploy a single package with both api and client ux.

Expand Down

0 comments on commit a9ddf6e

Please sign in to comment.