Skip to content

Commit

Permalink
Version 8.2.7 release (#4209)
Browse files Browse the repository at this point in the history
* Update version numbers to 8.2.7

* #4208 Select the correct IContextManager

* #4208 Update tests
  • Loading branch information
rockfordlhotka committed Sep 6, 2024
1 parent a2f861e commit 3349c29
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla.AspNetCore" Version="8.2.6" />
<PackageReference Include="Csla.AspNetCore" Version="8.2.7" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<ItemGroup>
<ProjectReference Include="..\..\ProjectTracker.BusinessLibrary\ProjectTracker.BusinessLibrary.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageReference Include="Csla.Blazor" Version="8.2.6" />
<PackageReference Include="Csla.Blazor.WebAssembly" Version="8.2.6" />
<PackageReference Include="Csla.Blazor" Version="8.2.7" />
<PackageReference Include="Csla.Blazor.WebAssembly" Version="8.2.7" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<ProjectReference Include="..\..\ProjectTracker.Dal\ProjectTracker.Dal.csproj" />
<ProjectReference Include="..\ProjectTracker.Blazor.Client\ProjectTracker.Blazor.Client.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.8" />
<PackageReference Include="Csla.AspNetCore" Version="8.2.6" />
<PackageReference Include="Csla.Blazor" Version="8.2.6" />
<PackageReference Include="Csla.AspNetCore" Version="8.2.7" />
<PackageReference Include="Csla.Blazor" Version="8.2.7" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="8.2.6" />
<PackageReference Include="Csla" Version="8.2.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="8.2.6" />
<PackageReference Include="Csla" Version="8.2.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="8.2.6" />
<PackageReference Include="Csla" Version="8.2.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
</ItemGroup>

Expand Down
19 changes: 18 additions & 1 deletion Source/Csla.Blazor.Test/AppContext/ContextManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void UseAsyncLocalApplicationContextManager()
}

[TestMethod]
public void UseAspNetCoreApplicationContextManager()
public void UseBlazorApplicationContextManager()
{
var services = new ServiceCollection();
services.AddScoped<AuthenticationStateProvider, AuthenticationStateProviderFake>();
Expand All @@ -90,6 +90,23 @@ public void UseAspNetCoreApplicationContextManager()
var activeState = serviceProvider.GetRequiredService<AspNetCore.Blazor.ActiveCircuitState>();
activeState.CircuitExists = false;

var applicationContext = serviceProvider.GetRequiredService<ApplicationContext>();
Assert.IsInstanceOfType(applicationContext.ContextManager, typeof(Csla.AspNetCore.Blazor.ApplicationContextManagerBlazor));
}

[TestMethod]
public void UseAspNetCoreApplicationContextManager()
{
var services = new ServiceCollection();
services.AddScoped<AuthenticationStateProvider, AuthenticationStateProviderFake>();
services.AddScoped<IHttpContextAccessor, HttpContextAccessorFake>();
services.AddCsla(o => o
.AddAspNetCore());
var serviceProvider = services.BuildServiceProvider();

var activeState = serviceProvider.GetRequiredService<AspNetCore.Blazor.ActiveCircuitState>();
activeState.CircuitExists = false;

var applicationContext = serviceProvider.GetRequiredService<ApplicationContext>();
Assert.IsInstanceOfType(applicationContext.ContextManager, typeof(Csla.AspNetCore.ApplicationContextManagerHttpContext));
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Csla.Xaml.Uwp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.2.6.0")]
[assembly: AssemblyFileVersion("8.2.6.0")]
[assembly: AssemblyVersion("8.2.7.0")]
[assembly: AssemblyFileVersion("8.2.7.0")]
12 changes: 5 additions & 7 deletions Source/Csla/Core/ApplicationContextAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ public ApplicationContextAccessor(
ServiceProvider = serviceProvider;
LocalContextManager = localContextManager;

foreach (var context in contextManagerList)
var managers = contextManagerList.ToList();
for (int i = managers.Count - 1; i >= 0; i--)
{
if (context.IsValid)
if (managers[i].IsValid)
{
ContextManager = context;
ContextManager = managers[i];
break;
}
}
if (ContextManager is null)
{
ContextManager = new Core.ApplicationContextManagerAsyncLocal();
}
ContextManager ??= new Core.ApplicationContextManagerAsyncLocal();
}

internal IServiceProvider ServiceProvider { get; }
Expand Down
2 changes: 1 addition & 1 deletion Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- Common Package Settings -->
<PropertyGroup>
<Version>8.2.6.0</Version>
<Version>8.2.7.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://cslanet.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/MarimerLLC/csla</RepositoryUrl>
Expand Down
12 changes: 12 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

CSLA 8 is a substantial update to CSLA .NET, adding support for .NET 8 and other enhancements.

## CSLA .NET version 8.2.7 release

Fixes a build issue with the 8.2.6 CSLA .NET NuGet packages.

### Change List

* https://github.com/MarimerLLC/csla/compare/v8.2.6...v8.2.7

### Contributors

* @rockfordlhotka

## CSLA .NET version 8.2.6 release

Fixes issues with the way `IContextManager` is resolved in Blazor apps in #4089 and #4182.
Expand Down

0 comments on commit 3349c29

Please sign in to comment.