Materializing objects inheriting from DynamicObject
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
A few days ago I found myself in the need to use Query<T> with an object inheriting from DynamicObject.
Currently, as per @mgravell's kind answer, this is not supported. He suggested I open an issue so you guys can take a look.
All references to my use case are detailed in my StackOverflow question linked above, along with a brief and by no means complete exchange of opinions as to how this could be handled.
Basically, the constructor for DefaultTypeMap (going from memory here, the names could be wrong) is quite PropertyInfo-centric, which would probably need to to be changed to also look at T and whether it implements IDynamicMetaObjectProvider.
The suggestions were to support DynamicObject-derived objects both for materializing and as parameters, hence:
- probing for
IDynamicMetaObjectProvider - allowing use of such objects as parameters, with the limitation that they have to provide an override for
GetDynamicMemberNames()
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DefaultTypeMap constructor and its PropertyInfo-centric lookup, then trace the materialization and parameter paths for types implementing IDynamicMetaObjectProvider. Done means DynamicObject-derived types are supported for materialization and parameters, with parameter objects requiring GetDynamicMemberNames() as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100