How to Parse JSON Data in C# - Coding Gems
Вставка
- Опубліковано 8 вер 2024
- In this Coding Gem, I will teach you how to easily serialize and de-serialize JSON data in C#!
💻Code: github.com/Par...
💻Learning C#: • Learning C#: Introduct...
Join us:
📺 / parametriccamp
💬 / discord
📷 / parametriccamp
🐦 / parametriccamp
💻github.com/Par...
📷🕺 / garciadelcastillo
🐦🕺 / garciadelcast
Hours spent searching for good tutorials and i finaly find this channel. Amazing video!
Thank you for this video, this really helped me. I'm just starting out in C# and I'm sure what I was trying to do could be done a lot better, but this was the easiest for me to understand!
Never seen anyone so good at explaining!
fantastic! clear, concise, and extremely helpful. Thank you!
Super helpful. All I wish this included was how to get just a portion of the JSON file as a string.
FANTASTIC. Very well done and explained so clearly. 10/10
Thank you! That was very helpful.
Thanks for your content! Clear and concise 👏
This is awesome. Thank you! Thank you!
Very nice video. You made it so easy. Thank you so much. 👍
It would be also nice if you could show us how to write data into the .json file :)
This is a great video and very clear, but I would like to see how you handle this case but with multiple strings of the same format you've shown here. Do you have to create multiple lists? Or can you do it with a list of lists (e.g. nested)?
Very useful, thanks - the only thing I would add is that I had access denied when trying to read in from a file (even when running VS 2022 as Administrator). Any tips on sorting that would be great (I'm on a work computer so it's hard to know what else might be going on in the background)
Thanks for this clear tutorial , helped a lot
Thank you! Well explained!
Great explanation.
FANTASTIC VIDEO
Very helpful.
Thank you very much
Nice video man thanks.
Amazing. How to enable Auto complete of visual studio? Can you guide please?
It is called IntelliSense. Should be under Tools -> Options -> Text Editor -> C# -> IntelliSense.
@@tuomaslehtonen1707 i cant find it under Tools. I have one in Visual studio -> Preference -> Text editor -> IntelliSense.
It’s enable but not working like shown in your video.
Didn’t saw anything related to C# in above path although I’m working with Unity & C#. Maybe a module is missing? 🤔
How to deserialize this Json, what to do with the word "producto" before the properties?
{
"producto": {
"iDpRODUCTO": 6,
"codigoBarra": 54323,
"nombre": "cera",
"marca": "avon",
"categoria": "belleza",
"precio": 3400
}
}
oh my god thank you
thansk!!
Ran into this early morning, helped me a bunch. Kinda stuck now, what do you do when you have "location": null? When I deserialize and try to read root.data.location, I get a System.NullReferenceException: 'Object reference not set to an instance of an object.'
Document_Parser.readjson.Data.dateOfBirth.get returned null.
Thanks
using ConsoleApp1;
using System.Text.Json;
var person = new Person("Kevin", 19);
var _serializeJSON = JsonSerializer.Serialize(person);
File.WriteAllText("file.json", _serializeJSON);
var readJSON = File.ReadAllText("file.json");
Person _deserialize = JsonSerializer.Deserialize(readJSON);
Console.WriteLine($"{_deserialize.Name} is {_deserialize.Age} years old.");
Console.ReadKey();