I have a composite model
public class Composite
{
public SubType1 Property1 {get;set}
public SubType2 Property2 {get;set}
public IDictionary<string, object> Property3 {get;set}
}
When WEB API hydrates it, Property3
contains ExpandoObject
. Then this composite type goes into Stage1 processing in the end of which it ends us as JSON in DB. In the Stage2, it is being pulled from DB and serialized like this
Composite comp = JsonConvert.DeserializeObject<Composite>(json);
At this point comp.Property3
is of type Dictionary<string, object>
Is there a way to tell JsonConvert
, which implementation of IDictionary<string, object>
for that property you need in each particular case? Jumping ahead I can say, I am not looking to get ExpandoObject
back but rather have ability to tell that this specific property should be of some specific type.