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

Поділитися
Вставка
  • Опубліковано 15 лип 2021
  • 🚀 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

КОМЕНТАРІ • 39

  • @tutorialsEU
    @tutorialsEU  Рік тому +1

    🚀Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7

  • @SamirNetCore
    @SamirNetCore 3 роки тому +28

    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 Рік тому +6

      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 21 день тому

    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.

  • @greyalice
    @greyalice 7 днів тому

    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.

  • @danielbekker8544
    @danielbekker8544 2 роки тому +1

    This video was amazing thank you for actually explaining the process and not just coding it

  • @lewisorherhe2689
    @lewisorherhe2689 2 роки тому +1

    The best video I have seen on Deserialization of JSON in C#

  • @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!

  • @eyemaneyeman9341
    @eyemaneyeman9341 2 роки тому

    great demo. Thank you

  • @kellybmackenzie
    @kellybmackenzie Рік тому

    Thank you so much, this is really helpful!!

  • @imadabab
    @imadabab 3 роки тому

    Beautiful. Thanks a lot

  • @richardmeyer418
    @richardmeyer418 3 роки тому

    Thank you, that was very useful.

  • @MrZtapp
    @MrZtapp Рік тому

    Best json tut I have seen

  • @Willian_dotNet_Alves
    @Willian_dotNet_Alves Рік тому

    Ótima explicação!

  • @JustJarred
    @JustJarred Рік тому

    You are a life saver man

  • @alexgolomb363
    @alexgolomb363 8 місяців тому

    Very helpful. Thank you.

  • @muralikrishnachowdarypolin5601
    @muralikrishnachowdarypolin5601 3 роки тому

    Very Useful thanks and continu the how to create local json server tutorial

  • @richardsrobin_r
    @richardsrobin_r 3 роки тому +1

    thanks ,it was helpfull,and how to download multiple images from json to display in listview or any view.

  • @gatatools
    @gatatools Рік тому

    I love this channel

  • @mariiasafonova5510
    @mariiasafonova5510 Рік тому

    very good job

  • @Phil_D_Waller
    @Phil_D_Waller 7 місяців тому

    great stuff!

  • @riccarrasquilla379
    @riccarrasquilla379 8 місяців тому

    thanks for the video

  • @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.

  • @abdulrehmanharis7193
    @abdulrehmanharis7193 Рік тому

    awesome.

  • @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

  • @yenjeff6790
    @yenjeff6790 2 роки тому +4

    謝謝!

  • @pelapps
    @pelapps 3 роки тому +1

    Can you tell me any suggestions on my first Android App ? Its available on Playstore. App name World of C++

  • @nordgaren2358
    @nordgaren2358 2 роки тому

    Dsrk souls references?

  • @echoness_
    @echoness_ Рік тому

    Thank you Dark Souls.

  • @fooballers7883
    @fooballers7883 Рік тому

    You are a star... thank you so much Really appreciate it. Thanks

  • @SirXtC
    @SirXtC Рік тому

    wow c# makes stuff so complicated compared to javascript lol.

  • @kavivarman4284
    @kavivarman4284 Рік тому

    Newtonsoft library severely degrade the application performance as it uses the reflection when deserialization big data.

  • @imikhan83
    @imikhan83 3 роки тому +6

    IMO, you should have used system.text.json. it's a built-in package and has more features and fast than newsoftjson...

    • @tutorialsEU
      @tutorialsEU  Рік тому +1

      Working on a new video for that. thanks for your feedback.