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

  Рет қаралды 41,207

tutorialsEU

tutorialsEU

Күн бұрын

🚀 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

Пікірлер: 41
@tutorialsEU
@tutorialsEU 2 жыл бұрын
🚀Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
@SamirNetCore
@SamirNetCore 3 жыл бұрын
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 2 жыл бұрын
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 Жыл бұрын
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
@greyalice
@greyalice 5 ай бұрын
Thank you! Been stuck on a problem for a bit, and the JSON to C# converter helped me visualize where I was going wrong so I could fix my JSON structure.
@lewisorherhe2689
@lewisorherhe2689 2 жыл бұрын
The best video I have seen on Deserialization of JSON in C#
@darrenwe1
@darrenwe1 5 ай бұрын
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.
@suelim12
@suelim12 2 ай бұрын
Legend ! thanks for this... I used this for a test on one of the apilayers api projects. You're explanations are great !
@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.
@MrZtapp
@MrZtapp 2 жыл бұрын
Best json tut I have seen
@JustJarred
@JustJarred Жыл бұрын
You are a life saver man
@gatatools
@gatatools 2 жыл бұрын
I love this channel
@alexgolomb363
@alexgolomb363 Жыл бұрын
Very helpful. Thank you.
@wllyck
@wllyck 2 жыл бұрын
Excellent explanation, Thank you!
@TheJoni50para
@TheJoni50para 2 жыл бұрын
Great and simple explanation, thank you!
@richardsrobin_r
@richardsrobin_r 3 жыл бұрын
thanks ,it was helpfull,and how to download multiple images from json to display in listview or any view.
@eyemaneyeman9341
@eyemaneyeman9341 2 жыл бұрын
great demo. Thank you
@riccarrasquilla379
@riccarrasquilla379 Жыл бұрын
thanks for the video
@kellybmackenzie
@kellybmackenzie 2 жыл бұрын
Thank you so much, this is really helpful!!
@Phil_D_Waller
@Phil_D_Waller Жыл бұрын
great stuff!
@fooballers7883
@fooballers7883 Жыл бұрын
You are a star... thank you so much Really appreciate it. Thanks
@muralikrishnachowdarypolin5601
@muralikrishnachowdarypolin5601 3 жыл бұрын
Very Useful thanks and continu the how to create local json server tutorial
@yenjeff6790
@yenjeff6790 2 жыл бұрын
謝謝!
@tutorialsEU
@tutorialsEU Жыл бұрын
Thank you very much!
@Willian_dotNet_Alves
@Willian_dotNet_Alves Жыл бұрын
Ótima explicação!
@mariiasafonova5510
@mariiasafonova5510 2 жыл бұрын
very good job
@imadabab
@imadabab 3 жыл бұрын
Beautiful. Thanks a lot
@richardmeyer418
@richardmeyer418 3 жыл бұрын
Thank you, that was very useful.
@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
@imikhan83
@imikhan83 3 жыл бұрын
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.
@nileshgopnarayan4464
@nileshgopnarayan4464 3 ай бұрын
What if you don't know the object type that server will return what to do
@abdulrehmanharis7193
@abdulrehmanharis7193 2 жыл бұрын
awesome.
@echoness_
@echoness_ Жыл бұрын
Thank you Dark Souls.
@pelapps
@pelapps 3 жыл бұрын
Can you tell me any suggestions on my first Android App ? Its available on Playstore. App name World of C++
@aL-vs8kh
@aL-vs8kh 8 ай бұрын
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.
@nordgaren2358
@nordgaren2358 2 жыл бұрын
Dsrk souls references?
@SirXtC
@SirXtC Жыл бұрын
wow c# makes stuff so complicated compared to javascript lol.
@kavivarman4284
@kavivarman4284 2 жыл бұрын
Newtonsoft library severely degrade the application performance as it uses the reflection when deserialization big data.
What are ASYNC and AWAIT in C#? Asynchronous Programming Tutorial
18:34
📚What is a Dictionary in C#?
27:26
tutorialsEU
Рет қаралды 31 М.
One day.. 🙌
00:33
Celine Dept
Рет қаралды 42 МЛН
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,5 МЛН
Using JSON IN C#! Serialization & Deserialization made easy!
14:47
tutorialsEU - C#
Рет қаралды 35 М.
Deserialize JSON Data to Custom C# Class Objects using Newtonsoft.
26:37
Software Nuggets
Рет қаралды 21 М.
Data Analysis with Python for Excel Users - Full Course
3:57:46
freeCodeCamp.org
Рет қаралды 3,3 МЛН
IEnumerable 🆚 IEnumerator Interfaces in C#
34:06
tutorialsEU
Рет қаралды 29 М.
Machine Learning for Everybody - Full Course
3:53:53
freeCodeCamp.org
Рет қаралды 8 МЛН
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
C Programming Tutorial for Beginners
3:46:13
freeCodeCamp.org
Рет қаралды 14 МЛН
Intro to WebAPI - One of the most powerful project types in C#
1:15:21
C# JSON Deserialization | Serialization and Deserialization| Nested Json #4
12:18
Binary Automation - SDETs
Рет қаралды 17 М.
One day.. 🙌
00:33
Celine Dept
Рет қаралды 42 МЛН