Deserialize JSON using C# and Newtonsoft.

preview_player
Показать описание
This is a hands-on tutorial.

The source code for this video is in the first pinned comment below. Please create a project on your local machine, and we can walk through this video together.

1) Load JSON input file (array)

2) call JsonConvert.DeserializeObject C# LIST(JSON file contents)

3) C# LIST is created

------------------------------------------------------*****----------------------------------------------------------------------
If you've found this videos useful and wish to show your support with a small XLM donation, feel free to use the following values:

XLM address
GC23BCI644P66PPNRGRMKFFVQZZXE3CSCGMFIYFV5OW4WCPM2XICKWQZ

XLM Memo
502087138
------------------------------------------------------*****--------------------------------------------------------------------

#softwareNuggets, #newtonsoft, #deserialize, #serialize, @SoftwareNuggets
Рекомендации по теме
Комментарии
Автор

This was very helpful! I am ashamed on how many hours I spent on deserializing JsonArray until I came across this video, thank you!

KseniiaBereziuk
Автор

Very helpful! Went through the basics, got to the more advanced stuff, and finished it off with the essentials. I'll be coming back to this every now and then to refresh my memory!

GurtMan
Автор

You're unbelievable, i get in trying to learn about json, and i end up learning a bunch of things along the way, it's very considering of you, thanks man .

hayderdif
Автор

Super helpful, and I love how relaxing your voice is! Thanks!

lukezeches
Автор

Sometimes Visual studios does not Import so well the JSON, I was looking for exactly this!!
Thanks a lot!

XonVloX
Автор

No better explanation could be given !!!! 😎

Suecia
Автор

i learned multiple things from this video, thank you so much!

islucidcrying
Автор

Hello, I watched your Video, but I have a question. When I do this Code:
static List<Customer>
{
string path = @"...";
if (File.Exists(path))
{
var json =
return json;
}
}
are ther many error messages. How can I fixe that?
So the first error massage is this "List<Customer>". It say The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?).
The Second errow massage is: "ExampleOneSimpleClassObjekt" it say: 'method': not all code paths return a value

The last error massage is after the "." there are no "DeserializeObject" and it say: 'reference' is an ambiguous reference between 'identifier' and 'identifier'

Vincent-sdve
Автор

Amazing video, thank you very much good sir!

codalite
Автор

Hello sir! I am working with our API in our website. I already fetch the data that I request from our API and serialize it into json format. But the problem is when I deserilize the json format into c# object. I got stock in this error "Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type ". Would you help me about this. Thanks if you reading this. I am newly in working API request.

garudakurt
Автор

Your simple tutorial made me solved one of my problems. What it the json file like this. How will you read it?
{
"cars": [
{"model": "Toyota", "color": "black", "pricemin": 1000, "pricemax": 5000},
{"model": "Honda", "color": "white", "pricemin": 6000, "pricemax": 10000}
]
"price": [
{"color": "black", "price": 2000},
{"color": "white", "price": 6000},
{"color": "black", "price": 7000},
{"color": "white", "price": 5000}

]
}

rogercute
Автор

Nice tutorial. Anyway, it does not solve my problem. What if I need all data from json including array property from upper nests? I guess another class need to be created for this.

erikzamecnik
Автор

so i am guessing we can't deserialize arbitrary json like in js for example ?

wtfdoiputhere
Автор

Good one,
But couldn't find a video for serialization of List

chandrashekharchougule
Автор

Hey Team, here is the source code for this video

SoftwareNuggets
Автор

боже ты можешь фулскрин снимать пожалуйста

yeagor
join shbcf.ru