Тёмный

JSON IN C# - Downloading Data and Making Objects From It 

tutorialsEU
Подписаться 96 тыс.
Просмотров 38 тыс.
50% 1

🚀 Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
JSON IN C# - Downloading Data and Making Objects From It
A common question for developers is how to use JSON in C#. Here, we'll dive into downloading data and making objects from it!
We will be using the Newtonsoft library that can easily import JSON data into a .NET object. This tutorial covers both parsing an existing file as well as reading live data from a URL.
JSON stands for JavaScript Object Notation.
which is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects.
The power of JSON is that we can convert strings into objects in any programming language and vice versa (convert objects to strings). which we can then send over the network or store locally to retrieve later.
A JSON object has the following format..
Our Curly brackets will contain the data of our JSON.
Then we write down the Key or the name of the variable, in this case name.
Then we add :
Followed by the value of the key (name) in this case it’s “Sif”.
And if we have more data we can add them separated by a comma ‘,’ followed by the key-value pairs.
In C# this JSON object will translate into an object with two properties, a name and age.
Then when we convert this JSON object or string into a player object we can deal with it as we normally use any C# object.
But how do we convert JSON to C# objects and vice versa? For that we use Serialization and Deserialization.
tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
Stay tuned and subscribe to tutorialsEU: goo.gl/rBFh3x

Опубликовано:

 

15 июл 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@tutorialsEU
@tutorialsEU Год назад
🚀Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
@SamirNetCore
@SamirNetCore 2 года назад
Good tutorial and helpful. Just wanted to add that VS2019 has a native function to convert JSON to C# classes built-in the IDE, just copy the the JSON and go to Edit> Paste Special> "Paste JSON as Classes" and it will convert the copied JSON into C# classes no matter how complex and paste it. Also you can do the same with XML.
@ragnarmusix9440
@ragnarmusix9440 Год назад
A this comment just saved tons of time.
@tutorialsEU
@tutorialsEU Год назад
This is super valuable feedback. We are working on a video, that does exactly that!
@rambi1072
@rambi1072 9 месяцев назад
Wow! That is insanely useful, I was just about to start typing out like 6 classes all with lots of attributes thinking there has to be an easier way of doing this lol. Thanks so much
@darrenwe1
@darrenwe1 11 дней назад
That json2csharp converter was all I needed. I just finished create a super complex set of classes for a project. If only I had know. Thanks.
@lewisorherhe2689
@lewisorherhe2689 2 года назад
The best video I have seen on Deserialization of JSON in C#
@danielbekker8544
@danielbekker8544 2 года назад
This video was amazing thank you for actually explaining the process and not just coding it
@davidbierman5717
@davidbierman5717 Год назад
Thank you. I couldn't figure this problem out for a while and this video is exactly what I needed.
@TheJoni50para
@TheJoni50para 2 года назад
Great and simple explanation, thank you!
@wllyck
@wllyck 2 года назад
Excellent explanation, Thank you!
@imadabab
@imadabab 2 года назад
Beautiful. Thanks a lot
@eyemaneyeman9341
@eyemaneyeman9341 2 года назад
great demo. Thank you
@kellybmackenzie
@kellybmackenzie Год назад
Thank you so much, this is really helpful!!
@richardmeyer418
@richardmeyer418 2 года назад
Thank you, that was very useful.
@JustJarred
@JustJarred Год назад
You are a life saver man
@MrZtapp
@MrZtapp Год назад
Best json tut I have seen
@Willian_dotNet_Alves
@Willian_dotNet_Alves Год назад
Ótima explicação!
@alexgolomb363
@alexgolomb363 8 месяцев назад
Very helpful. Thank you.
@muralikrishnachowdarypolin5601
@muralikrishnachowdarypolin5601 2 года назад
Very Useful thanks and continu the how to create local json server tutorial
@Phil_D_Waller
@Phil_D_Waller 7 месяцев назад
great stuff!
@gatatools
@gatatools Год назад
I love this channel
@mariiasafonova5510
@mariiasafonova5510 Год назад
very good job
@riccarrasquilla379
@riccarrasquilla379 7 месяцев назад
thanks for the video
@abdulrehmanharis7193
@abdulrehmanharis7193 Год назад
awesome.
@richardsrobin_r
@richardsrobin_r 2 года назад
thanks ,it was helpfull,and how to download multiple images from json to display in listview or any view.
@aL-vs8kh
@aL-vs8kh 3 месяца назад
This tutorial had some information, however the way things are explained are only applicable when it's setup this exact way. It would be nice to know how to modify, change things for different circumstances because the likely hood of coding in this exact method will probably not be high.
@yenjeff6790
@yenjeff6790 2 года назад
謝謝!
@tutorialsEU
@tutorialsEU Год назад
Thank you very much!
@Nuns341
@Nuns341 Год назад
great stuff, you should make it so that lets say these JSON object can be stored in a database, how one can achieve that
@nordgaren2358
@nordgaren2358 2 года назад
Dsrk souls references?
@pelapps
@pelapps 2 года назад
Can you tell me any suggestions on my first Android App ? Its available on Playstore. App name World of C++
@echoness_
@echoness_ Год назад
Thank you Dark Souls.
@SirXtC
@SirXtC Год назад
wow c# makes stuff so complicated compared to javascript lol.
@fooballers7883
@fooballers7883 Год назад
You are a star... thank you so much Really appreciate it. Thanks
@kavivarman4284
@kavivarman4284 Год назад
Newtonsoft library severely degrade the application performance as it uses the reflection when deserialization big data.
@imikhan83
@imikhan83 2 года назад
IMO, you should have used system.text.json. it's a built-in package and has more features and fast than newsoftjson...
@tutorialsEU
@tutorialsEU Год назад
Working on a new video for that. thanks for your feedback.
Далее
IEnumerable 🆚 IEnumerator Interfaces in C#
34:06
Просмотров 27 тыс.
Кошка-ГОНЧАР #шортс #shorts
00:28
Просмотров 324 тыс.
ОБНОВАА?? ЛУТАЕМ МЕГАЯЩИКИ
3:12:14
Просмотров 312 тыс.
Learn JSON in 10 Minutes
12:00
Просмотров 3,1 млн
Is LEARNING WPF still WORTH it in 2023?
10:59
Просмотров 39 тыс.
Top 10 C# Best Practices (plus bonuses)
57:28
Просмотров 509 тыс.
Кошка-ГОНЧАР #шортс #shorts
00:28
Просмотров 324 тыс.