문제

I have a data table in my database where I store various settings. Since they are of any type (even complex object graphs) I decided to store their values as serialized JSON strings.

Let's say that I serialized a List<ItemBase>. Serialized string looks just fine. But the problem is that list items are of various types that are inherited from ItemBase (which may as well be abstract for what I care).

Question

Which (de)serialization class/library should I use so my JSON strings will be correctly deserialized to correct object instances.

도움이 되었습니까?

해결책

json.net has the ability to preserve references

And it supports storing the type

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top