Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSLA 8 can pick the aspnetcore IContextManager over Blazor #4208

Closed
rockfordlhotka opened this issue Sep 6, 2024 · 0 comments · Fixed by #4209 or #4211
Closed

CSLA 8 can pick the aspnetcore IContextManager over Blazor #4208

rockfordlhotka opened this issue Sep 6, 2024 · 0 comments · Fixed by #4209 or #4211
Assignees

Comments

@rockfordlhotka
Copy link
Member

In a server-interactive page in Blazor 8, the ApplicationContextAccessor will sometimes pick the aspnetcore IContextManager when it should use the Blazor server context manager.

The constructor needs to walk backwards through the list of registered IContextManager services so it selects the one that is valid and is also the most recently added to the list.

      var managers = contextManagerList.ToList();
      for (int i = managers.Count - 1; i >= 0; i--)
      {
        if (managers[i].IsValid)
        {
          ContextManager = managers[i];
          break;
        }
      }
      ContextManager ??= new Core.ApplicationContextManagerAsyncLocal();
@rockfordlhotka rockfordlhotka self-assigned this Sep 6, 2024
rockfordlhotka added a commit that referenced this issue Sep 6, 2024
@rockfordlhotka rockfordlhotka linked a pull request Sep 6, 2024 that will close this issue
rockfordlhotka added a commit that referenced this issue Sep 6, 2024
* Update version numbers to 8.2.7

* #4208 Select the correct IContextManager

* #4208 Update tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant