Skip to content
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

OData.Client 8.2.1 does not materialize data service responses #1354

Closed
dotnetero opened this issue Nov 18, 2024 · 1 comment
Closed

OData.Client 8.2.1 does not materialize data service responses #1354

dotnetero opened this issue Nov 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@dotnetero
Copy link

dotnetero commented Nov 18, 2024

I apologize, I wrote this report, but it should have been in the OData.Net section, if any administrator can delete it, I would appreciate it.

Assemblies affected

  • Microsoft.OData.Client 8.2.1
  • Microsoft.OData.Core 8.2.1
  • Microsoft.OData.Edm 8.2.1
  • Microsoft.Spatial 8.2.1

Other libraries used in the project:

  • Microsoft.EntityFrameworkCore 9.0.0
  • Microsoft.EntityFrameworkCore.Design 9.0.0
  • Microsoft.EntityFrameworkCore.SqlServer 9.0.0
  • Microsoft.EntityFrameworkCore.Tools 9.0.0
  • Microsoft.AspNetCore.OData 9.1.0

Describe the bug

In all requests made by using a unit of work that encapsulates a DataServiceContext, it is not possible to materialize the results, obtaining the same error in all methods "Value cannot be null (Parameter 'key')".

Multiple client applications were programmed on Blazor Server, Wpf Core, among others. These must consume multiple services made with AspNetCore.OData, prior to updating to the assemblies mentioned above, everything worked fine, at this time the calls to the OData services do not materialize.
AspNetCore.OData services work well and return results correctly.

Reproduce steps

  • Create an API with AspNetCore.OData, which consumes data from a database in Sql Server with or without primary keys.
  • Use the OData Connected Service extension to read the metadata and create the class for consumption in client applications.
  • Make a request to the data service, and it should throw the error mentioned above.

Data Model

image

EDM (CSDL) Model

image

Request/Response

Request:
image

Response:
The following image shows that the data service adequately responds to all methods:
image
The response it´s empty on blazor server app or Wpf app.

Expected behavior

Whether the data service returns IQueryable, Enumerable, List, etc. It is expected to be able to materialize these results for consumption in client applications.

Screenshots
image
image
image
image

Additional context

If you use Microsoft.OData.Client 8.1.0, everything works as expected. Leaving client applications with Net 9 and data services with AspNetCore.Odata 9.1.0 and EntityFrameworkCore 9.0.0.

@dotnetero dotnetero added the bug Something isn't working label Nov 18, 2024
@dotnetero dotnetero changed the title OData Services Responses do not materialize OData.Client 8.2.1 does not materialize data service responses Nov 18, 2024
@habbes
Copy link
Contributor

habbes commented Nov 19, 2024

This is a client-side issue. See: OData/odata.net#3124

@habbes habbes closed this as completed Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants