OData / OData/AspNetCoreOData

Using JsonDocument property for models

Open
#586 5 comments 3 reactions 1 assignee View on GitHub

@xuzhg is already working on this.

Since May 3, 2022.

followup question
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Hi there,

I'm trying to leverage JsonDocument as part of dto classes and add ability to filter on such properties.
I'm facing two issues here:

  1. As I'm not using neither OdataController nor OData routing I don't need to provide EdmModel and thus I have no way to tell that my JsonDocument is an Open type which supports property access
  2. I have no way to intercept Expression building procedure in FilterBinder so I could convert dynamic property access to calls to JsonDocuments GetProperty().GetRawText() https://github.com/OData/AspNetCoreOData/blob/dad7c4cf04202a26e61b4e1517443ae9e81eb646/src/Microsoft.AspNetCore.OData/Query/Expressions/QueryBinder.cs#L299
    Because obviously JsonDocument have no PropertyInfo (I even tried to wrap JsonDocument into DynamicObject)

Could someone suggest a proper way of doing this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.