You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the OData client, attempting to filter and select values from a dictionary of dynamic properties within a LINQ query results in an error or unexpected behavior. Specifically, the following pattern is not supported:
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Expected result
The OData client should correctly translate the LINQ query into an OData request, filtering the DynamicProperties dictionary for the specified key ("MiddleName") and returning the corresponding value.
Actual result
What is actually happening.
An error gets thrown: Error translating Linq expression to URI: Can only specify query options (orderby, where, take, skip) after last navigation
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.
The text was updated successfully, but these errors were encountered:
ElizabethOkerio
changed the title
Using LINQ to perform the various query operations on dynamic properties not supported in OData Client
Using LINQ to perform various query operations on dynamic properties not supported in OData Client
Aug 23, 2024
Is the intent to generate a query like GET /accounts/101?$select=AccountInfo/MiddleName? I don't think the syntax of .Select(a => a.AccountInfo.DynamicProperties.Where(dp => dp.Key == "MiddleName").Single()) is really a clear way for users to request that URL
Is the intent to generate a query like GET /accounts/101?$select=AccountInfo/MiddleName? I don't think the syntax of .Select(a => a.AccountInfo.DynamicProperties.Where(dp => dp.Key == "MiddleName").Single()) is really a clear way for users to request that URL
How should users then request for this URL? If they are using the DynamicProperties container generated by OData Connected Service? If they want to select the open properties in the container.
When using the OData client, attempting to filter and select values from a dictionary of dynamic properties within a LINQ query results in an error or unexpected behavior. Specifically, the following pattern is not supported:
Assemblies affected
Microsoft.OData.Client 8.x.
Reproduce steps
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Expected result
The OData client should correctly translate the LINQ query into an OData request, filtering the DynamicProperties dictionary for the specified key ("MiddleName") and returning the corresponding value.
Actual result
What is actually happening.
An error gets thrown: Error translating Linq expression to URI: Can only specify query options (orderby, where, take, skip) after last navigation
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.
The text was updated successfully, but these errors were encountered: