adc90
Getting user credentials blazor
I have a blazor application I'm working on as part of a group. Our components are set as ServerPrerendered. I get my token back parse it into credentials and put that in a scoped service and get the info that way. Everything is golden util the circuit is disconnected, I store the token in localStorage, however I can't get it until OnAfterRenderAsync. However that's not how our application is set up. It expects the credentials to be there on OnInitializedAsync. Is there anyway to force a particular component to run first, render and be able to pull information from the Javascript and then put it back into the DI for subsequent components to use. Or would the application have to be reworked so that any credentials are retrieved OnAfterRenderAsync
1 replies
❔ Parsing an OData filter string
I have a project that has a mildly complex query requirement. I'm using radzen to build a filter and apply it to a view that acts as my data set. Most everything works fine however when I try to filter by DateTime I get an error
Conversion failed when converting date and/or time from character string.
This is coming from the end resulting query which directly below. Which has the time portion which I don't need/can't use that way.
Which gets me the below expression I pass directly to an entity framework where clause which
Then generates the problematic where clause
OData Query
There is more to the code including a section where I parse the OData query into a OData expression using an EDM which I'm not super familiar with. I left that out for brevity but I can post it if need be.
3 replies
❔ Authentication with blazor pre-rendered
I'm doing Authentication in blazor, we're using ProtectedBrowserStorage to store the user object. As such when I render components OnInitializedAsync I don't have access to the user object as it's stored client side. Is it the pattern to just do setup of a component OnAfterRenderAsync or is there a way to have access to the user object in OnInitializedAsync. I was thinking I could keep it in a server cookie but I'm not sure how to go about that.
7 replies
❔ Issues separating build artifacts in dev ops
I'm having trouble packaging some artificats in dev ops, I have an IO and an Presntation project. The presentation layer keeps being coppied into the API collateral as well as separately
MainProject.sln
- Model_Library.csproj
- StaticUtilities.csproj
- BlazorServerApp.csproj
- APIWorkerForBlazorServerApp.csproj
Desired goal
* Artifacts
Presentation/
BlazorServerApp.dll
Resources
wwwwroot, etc
API/
APIWorkerForBlazorServerApp.dll
Resources
Actual Outcome
* Artifacts
Presentation/
BlazorServerApp.dll
Resources
wwwwroot, etc
API/
APIWorkerForBlazorServerApp.dll
Resources
Presentation/
BlazorServerApp.dll
Resources
wwwwroot, etc
Build steps are
.NET CORE: Restore
Build API
.NET CORE: Publish to artificat directory
ASP Publish to file location
rx/API
Build Presentation
.NET CORE: Publish to artificat directory
ASP Publish to file location
rx/Presentation
I'm thinking maybe the deploy web app step on I think publish is looking for appsettings.json so it grabs presentation collateral and shoves in inside my io collateral
4 replies