Answer the question
In order to leave comments, you need to log in
Can json parser implicitly cast jsonParse(string).ToObject() when parsed to descendants?
Can json parser implicitly cast jsonParse(string).ToObject<>() when parsing to heirs
if the abstract class from which everyone is inherited is known?
Answer the question
In order to leave comments, you need to log in
Here, after all, the parser is not engaged in casting. Here you need to ask if the language itself allows you to do this.
If you do something like children something = (children)jsonParse(string).ToObject<>(); then unpacking will occur and everything will be ok.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question