![]() ![]() ![]() Without MaxDepth, JsonConvert is going to dutifully serialize most or all of the entire database. SerializeObject(user, new JsonSerializerSettings ) would be useful for containing JSON serialization to just the user and their FK Ids. An exception is undesirable behavior in many circumstances.Ī good example of where this is useful is on an Entity Framework database with LazyLoading enabled and virtual properties throughout. It would help if there was a way to tell it to simply serialize/deserialize down to MaxDepth and stop. ![]() But, you can't currently tell it to only serialize down to a certain depth.Īdditionally, it appears that the normal behavior of MaxDepth is to throw an exception, which is not desirable. It would be helpful if MaxDepth worked on SerializeObject() as well, not just Deserialize().Ĭurrently, you can use MaxDepth to stop the serializer from deserializing anything past a given depth on the initial object(s). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |