I've been working on this issue for sometime, not constant, but I would work on it then stop then go back. So this is a multi-tenant blazor server app. I have a CustomAuthenicationStateProvider that pulls the Tenant Id from the ApplicationUser and stores it in a TenantIdServiceProvider that is used in the DbContextFactory for setting the QueryFilter.
In the Service class I Create the DBcontext from the Injected IDBContextFactory.
This works ok until I add @rendermode InteractiveServer to my blazor pages. In this scenario, the prerender returns data, but when on the second render the Tenant Id is null, so the data disappears from the page.
Now if I set the "prerender to false" then i get no data, the Tenant Id is always empty.If i call the Data Service in "OnAfterRenderAsync" the no data is returned. the Tenant id is empty.
I'm going to work up a simple example, but in the mean time. Does anyone know how to fix this?