Answer the question
In order to leave comments, you need to log in
How to serialize complex object to JSON?
I want to store information about levels in separate files, and I can't figure out how to serialize such an object. As you understand the main trouble in the sheet (can be replaced with an array).
Answer the question
In order to leave comments, you need to log in
How do you understand the main trouble in the sheet (can be replaced with an array)
var obj = new TestObject { SomeField = "asd" };
JsonSerializer.Serialize(obj, new JsonSerializerOptions() { IncludeFields = true });
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question