Open craigedmunds opened 2 months ago
Yes, something like that would be great to have. To implement that, the ResourceGraph
first needs to be extended to support these inline/complex properties, which is also required for https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1439. Then query string parsers can validate input against the resource graph. Then query translation needs to be extended to emit LINQ expressions for them.
I suspect it can be done with EF Core, just haven't investigated it deeply yet. I don't know if the MongoDB LINQ provider can handle such queries (but the answer is likely yes).
Some experimentation, followed by a working prototype, would help to discover how to best design this. For example, we could inherit from AttrAttribute
or from ResourceFieldAttribute
, or enhance the existing AttrAttribute
. This depends on their usages throughout the codebase, what information is needed where, etc.
@craigedmunds Are you still interested in contributing to achieve this?
We want to be able to support sorting, paging & filtering of nested documents.
So given “transactions” records like
You should be able to query things like: ?sort=user.name ?fields[transaction]=user.name ?filter[user.name][eq]=whatever
We’ve considered using a different framework, and are happy to contribute if a design is agreed.