Skip to content

Commit

Permalink
#3890 Update BlazorExample for latest changes (CSLA 9)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfordlhotka committed May 3, 2024
1 parent e7407bf commit 3396e5c
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 30 deletions.
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla.Blazor.WebAssembly" Version="8.0.0-R24021201" />
<PackageReference Include="Csla.Blazor.WebAssembly" Version="9.0.0-R24050201" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
</ItemGroup>

Expand Down
@@ -1,6 +1,5 @@
@page "/counter"
@rendermode @(new InteractiveAutoRenderMode(prerender: false))
@implements IDisposable /* CSLA wasm pages must be IDisposable */
@inject Csla.Blazor.State.StateManager StateManager

<PageTitle>Counter</PageTitle>
Expand All @@ -26,10 +25,4 @@
{
currentCount++;
}

public void Dispose()
{
// wasm pages _must_ save state back to server
StateManager.SaveState();
}
}
@@ -1,7 +1,6 @@
@page "/editperson"
@page "/editperson/{id}"
@rendermode @(new InteractiveWebAssemblyRenderMode(prerender: false))
@implements IDisposable /* CSLA wasm pages must be IDisposable */
@inject Csla.Blazor.State.StateManager StateManager
@inject Csla.IDataPortal<PersonEdit> personEditPortal
@inject Csla.Blazor.ViewModel<PersonEdit> vm
Expand Down Expand Up @@ -86,10 +85,4 @@ else
else
await vm.RefreshAsync(() => personEditPortal.FetchAsync(int.Parse(id)));
}

public void Dispose()
{
// wasm pages _must_ save state back to server
StateManager.SaveState();
}
}
@@ -1,5 +1,4 @@
@page "/listpersons"
@attribute [StreamRendering] /* server-static pages must be streaming */
@inject Csla.Blazor.State.StateManager StateManager
@inject Csla.IDataPortal<PersonList> personListPortal
@inject Csla.Blazor.ViewModel<PersonList> vm
Expand Down
Expand Up @@ -12,8 +12,8 @@
<ProjectReference Include="..\DataAccess.EF\DataAccess.EF.csproj" />
<ProjectReference Include="..\DataAccess.Mock\DataAccess.Mock.csproj" />
<ProjectReference Include="..\DataAccess\DataAccess.csproj" />
<PackageReference Include="Csla.AspNetCore" Version="8.0.0-R24021201" />
<PackageReference Include="Csla.Blazor" Version="8.0.0-R24021201" />
<PackageReference Include="Csla.AspNetCore" Version="9.0.0-R24050201" />
<PackageReference Include="Csla.Blazor" Version="9.0.0-R24050201" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.1" />
</ItemGroup>

Expand Down
@@ -1,5 +1,4 @@
@page "/"
@attribute [StreamRendering] /* server-static pages must be streaming */
@inject Csla.Blazor.State.StateManager StateManager

<PageTitle>Home</PageTitle>
Expand All @@ -8,17 +7,11 @@

<p>Welcome to your new CSLA Blazor app.</p>

<p>CSLA state is ready: @IsStateReady</p>

@code
{
private bool IsStateReady;

protected override async Task OnInitializedAsync()
{
// Every page _must_ initialize the state manager
await StateManager.InitializeAsync();
// CSLA state is not available until this page has rendered one time
IsStateReady = StateManager.IsStateAvailable;
}
}
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Csla;
using Csla.State;
using Csla.Blazor.State.Messages;

namespace BlazorExample.Controllers
{
Expand All @@ -15,7 +16,7 @@ namespace BlazorExample.Controllers
public class CslaStateController(ApplicationContext applicationContext, ISessionManager sessionManager) :
Csla.AspNetCore.Blazor.State.StateController(applicationContext, sessionManager)
{
public override byte[] Get() => base.Get();
public override StateResult Get(long lastTouched) => base.Get(lastTouched);

public override void Put(byte[] updatedSessionData) => base.Put(updatedSessionData);
}
Expand Down
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="8.0.0-R24021201" />
<PackageReference Include="Csla" Version="9.0.0-R24050201" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="8.0.0-R24021201" />
<PackageReference Include="Csla" Version="9.0.0-R24050201" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1">
<PrivateAssets>all</PrivateAssets>
Expand Down
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="8.0.0-R24021201" />
<PackageReference Include="Csla" Version="9.0.0-R24050201" />
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="8.0.0-R24021201" />
<PackageReference Include="Csla" Version="9.0.0-R24050201" />
</ItemGroup>


Expand Down

0 comments on commit 3396e5c

Please sign in to comment.