diff --git a/Samples/ProjectTracker/ProjectTracker.AppServer/ProjectTracker.AppServer.csproj b/Samples/ProjectTracker/ProjectTracker.AppServer/ProjectTracker.AppServer.csproj index 4df4262866..8d8949c5d0 100644 --- a/Samples/ProjectTracker/ProjectTracker.AppServer/ProjectTracker.AppServer.csproj +++ b/Samples/ProjectTracker/ProjectTracker.AppServer/ProjectTracker.AppServer.csproj @@ -7,7 +7,7 @@ - + diff --git a/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor.Client/ProjectTracker.Blazor.Client.csproj b/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor.Client/ProjectTracker.Blazor.Client.csproj index abfaec3725..83274df389 100644 --- a/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor.Client/ProjectTracker.Blazor.Client.csproj +++ b/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor.Client/ProjectTracker.Blazor.Client.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor/ProjectTracker.Blazor.csproj b/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor/ProjectTracker.Blazor.csproj index 5cd7969984..8ccaf71058 100644 --- a/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor/ProjectTracker.Blazor.csproj +++ b/Samples/ProjectTracker/ProjectTracker.Blazor/ProjectTracker.Blazor/ProjectTracker.Blazor.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/Samples/ProjectTracker/ProjectTracker.BusinessLibrary/ProjectTracker.BusinessLibrary.csproj b/Samples/ProjectTracker/ProjectTracker.BusinessLibrary/ProjectTracker.BusinessLibrary.csproj index 4d6e2beabb..946861391f 100644 --- a/Samples/ProjectTracker/ProjectTracker.BusinessLibrary/ProjectTracker.BusinessLibrary.csproj +++ b/Samples/ProjectTracker/ProjectTracker.BusinessLibrary/ProjectTracker.BusinessLibrary.csproj @@ -7,7 +7,7 @@ - + diff --git a/Samples/ProjectTracker/ProjectTracker.Dal/ProjectTracker.Dal.csproj b/Samples/ProjectTracker/ProjectTracker.Dal/ProjectTracker.Dal.csproj index 8ab6e2463a..b49ff0c4db 100644 --- a/Samples/ProjectTracker/ProjectTracker.Dal/ProjectTracker.Dal.csproj +++ b/Samples/ProjectTracker/ProjectTracker.Dal/ProjectTracker.Dal.csproj @@ -7,7 +7,7 @@ - + diff --git a/Samples/ProjectTracker/ProjectTracker.DalMock/ProjectTracker.DalMock.csproj b/Samples/ProjectTracker/ProjectTracker.DalMock/ProjectTracker.DalMock.csproj index 7a7c6dbb77..37aedb4e26 100644 --- a/Samples/ProjectTracker/ProjectTracker.DalMock/ProjectTracker.DalMock.csproj +++ b/Samples/ProjectTracker/ProjectTracker.DalMock/ProjectTracker.DalMock.csproj @@ -7,7 +7,7 @@ - + diff --git a/Source/Csla.Blazor.Test/AppContext/ContextManagerTests.cs b/Source/Csla.Blazor.Test/AppContext/ContextManagerTests.cs index a56dc99eb9..6974115f7d 100644 --- a/Source/Csla.Blazor.Test/AppContext/ContextManagerTests.cs +++ b/Source/Csla.Blazor.Test/AppContext/ContextManagerTests.cs @@ -77,7 +77,7 @@ public void UseAsyncLocalApplicationContextManager() } [TestMethod] - public void UseAspNetCoreApplicationContextManager() + public void UseBlazorApplicationContextManager() { var services = new ServiceCollection(); services.AddScoped(); @@ -90,6 +90,23 @@ public void UseAspNetCoreApplicationContextManager() var activeState = serviceProvider.GetRequiredService(); activeState.CircuitExists = false; + var applicationContext = serviceProvider.GetRequiredService(); + Assert.IsInstanceOfType(applicationContext.ContextManager, typeof(Csla.AspNetCore.Blazor.ApplicationContextManagerBlazor)); + } + + [TestMethod] + public void UseAspNetCoreApplicationContextManager() + { + var services = new ServiceCollection(); + services.AddScoped(); + services.AddScoped(); + services.AddCsla(o => o + .AddAspNetCore()); + var serviceProvider = services.BuildServiceProvider(); + + var activeState = serviceProvider.GetRequiredService(); + activeState.CircuitExists = false; + var applicationContext = serviceProvider.GetRequiredService(); Assert.IsInstanceOfType(applicationContext.ContextManager, typeof(Csla.AspNetCore.ApplicationContextManagerHttpContext)); } diff --git a/Source/Csla.Xaml.Uwp/Properties/AssemblyInfo.cs b/Source/Csla.Xaml.Uwp/Properties/AssemblyInfo.cs index dbe1f94b8a..0f81fa3def 100644 --- a/Source/Csla.Xaml.Uwp/Properties/AssemblyInfo.cs +++ b/Source/Csla.Xaml.Uwp/Properties/AssemblyInfo.cs @@ -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")] \ No newline at end of file +[assembly: AssemblyVersion("8.2.7.0")] +[assembly: AssemblyFileVersion("8.2.7.0")] \ No newline at end of file diff --git a/Source/Csla/Core/ApplicationContextAccessor.cs b/Source/Csla/Core/ApplicationContextAccessor.cs index 7fd6a4e0b7..1edb807bfc 100644 --- a/Source/Csla/Core/ApplicationContextAccessor.cs +++ b/Source/Csla/Core/ApplicationContextAccessor.cs @@ -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; } diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index 2a337d9b69..9ab26b9fec 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -6,7 +6,7 @@ - 8.2.6.0 + 8.2.7.0 MIT https://cslanet.com https://github.com/MarimerLLC/csla diff --git a/releasenotes.md b/releasenotes.md index ea81c7d90e..ebde0635b0 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -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.