I'm solving this problem like that: injecting factories of dependencies. In those factories, first resolve dependency as it is registered in container, then "deserializing" all remaining data: json.net allows to populate fields in existing object.
As factories code goes along with wiring code of IoC container, I don't think using container.Resolve
inside factory violates the rule, that container
have to be used just in one place in code: where all wiring happens.
As of now, I'm trying to make this process automatic (as opposed to what I've been testing that approach at) using reflection. Yes, there is not much what does remain from json.net deserialization itself, part of it is substituted with custom code, but I think, why bother.
Also, what was your final thoughts/decision on the matter? After reading this post i see two ways: deserialize, then inject; or inject, then deserialize (populate). And i still find my way is better. Will be glad to hear arguments in opposition to this (i'm regarding, that my way may be better for my case, but can't vividly imagine good alternative cases, where it fails, just some minor guesses)