CSLA Fails When Invoking a Blazor Page with Parameters #4198
Unanswered
ecaldentey
asked this question in
Questions
Replies: 2 comments 7 replies
-
I added a try-catch block around the code try The error message is: "Cannot access a disposed object. Object name: 'IServiceProvider'." However, if the page doesn't receive parameters, the fetch is executed perfectly. |
Beta Was this translation helpful? Give feedback.
7 replies
-
What version of CSLA? We fixed a bug about this at some point if I remember correctly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Rocky,
For some reason, when I invoke a Blazor page passing parameters, CSLA throws an error. If I invoke the page without passing a parameter, everything works fine.
@page "/NewContract"
@page "/NewContract/{dealType}"
When I invoke the page with the following code:
NavLink href="/NewContract/Contract" class="nav-link"
Csla throws an error when fetching objects.
If I invoke it with the following code:
NavLink href="/NewContract" class="nav-link"
Everything works fine.
The error occurs in the OnAfterRenderAsync method when fetching the objects.
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await StateManager.InitializeAsync();
}
The GetAsync method executes fine, and the flow moves to the DataPortal side where the Fetch method is executed. However, upon exiting the Fetch method, an error is generated.
[Fetch]
private void Fetch(CustomerInfo.FilterCriteria filterCriteria, [Inject] ICustomerDal dal, [Inject] IChildDataPortal dataPortal)
{
try
{
#region [TryFetchData]
}
If the page is called without passing parameters, everything works fine.
What could be causing the error?
Beta Was this translation helpful? Give feedback.
All reactions