-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Blazor Wasm Eval: System.InvalidOperationException: Operation is not valid due to the current state of the object. #836
Comments
I did not check your example yet. Will do that at end of week. Probably your issue is another issue as described here? |
I had looked at this article prior to submitting the issue. This happens in debug mode and when I have the |
I did not find the real issue yet, as a workaround you can use: var allOrderItemsDynamic = orders.AsQueryable()
.Select("new (OrderId as Id, OrderItems.Where(w => true) as Children, null as Empty)")
.ToDynamicList<DynamicClass>();
foreach (var element in allOrderItemsDynamic)
{
object elementAsObj = element;
var idReflection = elementAsObj.GetType().GetProperty("Id")!.GetValue(elementAsObj);
Console.WriteLine("idReflection = " + idReflection);
Console.WriteLine("dynamic = " + element["Id"]);
} |
Can you try preview version |
@StefH I'm not seeing version 1.4.5 in that feed. |
Doh! I was not paying attention and did not have the box checked. Sorry about that. I tested the updated library on my sample and can confirm the property evaluations now work without exceptions. Thanks. |
Here is what to include in your request to make sure we implement a solution as quickly as possible.
1. Description
Dynamic objects created by the library throw the following exception when accessing their properties in Blazor Wasm
2. Exception
If you are seeing an exception, include the full exception details (message and stack trace).
3. Fiddle or Project
Run the home page to reproduce.
WasmDynamicLinq.zip
The text was updated successfully, but these errors were encountered: