C Serialize List Of Objects
Posted : admin On 10/6/2019To serialize a collection - a generic list, array, dictionary, or your own custom collection - simply call the serializer with the object you want to get JSON for. Json.NET will serialize the collection and all of the values it contains.
- Jun 11, 2013 Hello everybody, I need to serialize a list of string text to xml and then desearialze it. List looks like 10, 6, 7, 11 and etc. How should I do this?
- Feb 06, 2016 How to serialize a list of objects using the XML Serializer in C#. How to Serialize Multiple and DIFFERENT Types of Objects in Java - Duration: 46:28. Lightfalls 8,715 views.
- How to implement custom JsonConverter in JSON.NET to deserialize a List of base class objects? 393 How can I change property names when serializing with Json.net?
- I need some suggestions on how to import data into multiple list objects using Dapper and then serialize the lists into proper JSON format. Please share your suggestions. Sample JSON fo.

I Use JsonConvert to serialize object and save it on database. It's sample of serialize string that I save in database:
Unable to download podcast iphone. [{'matId':'1','value':'44'},{'matId':'2','value':'55'},{'matId':'4','value':'77'}]
Now when I get this string from db it has a lot of backslash like this:
'[{'matId':'1','value':'44'},{'matId':'2','value':'55'},{'matId':'4','value':'77'}]'
And for this reason I can't Deserialize it.
.Replace(',') method doesn't any affect on this. Microsoft fonts list. I don't know why.
2 Answers
You have to use JsonConvert.Deserialize method.
C# Serialize List Of Strings
Your json string is wrapped within square brackets ([]), hence it is interpreted as array. Therefore, you need to deserialize it to type collection of one class, for example let's call it MyClass.
Here is Deserialize method.
Backslashes represent serialized object. You need to deserialize your List object.You can try using Generics:
C# Serialize Object To File
