Open phatcher opened 5 years ago
@object Can we push this forward? Is there an injectable temporary workaround that will enable reading the type from the json and metadata and decide on which object it should be deserialized to? I'm willing to help.
@weitzhandler I've just issued a pull request for this
Thank you! ❤
At the moment if you have a type hierarchy you have to use a custom converter to correctly populate the subtypes, since the ToObject does not use the ODataEntryAnnotations.TypeName to select the correct CLR type, just taking the provided value. For example, given the class hierarchy
All the values returned will be of type Animal; this applies whether you are retrieving it as a pure retrieval or via an expand.
With the introduction of the ITypeCache etc, we have all the information necessary to automatically determine the type to match to and can avoid needing the custom converter finally addressing #158