Serialize and Deserialize Json to C# [Step By Step Tutorial of JSON in C# in Hindi ] (हिंदी)

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • This is a Step By Step Tutorial of using Json in C#. In this video you can see how Serialize and Deserialize Json strings in C# - Json to C#. We are using Newtonsoft JSON and System .Text.Json Library for managing Json. The sample project showing in this video is developed in Visual Studio 2022 using (C#/C Sharp Language) from Microsoft
    JSON (JavaScript Object Notation) is a standard file format used to interchange data. The data objects are stored and transmitted using key-value pairs and array data types. JSON has syntactic similarity to JavaScript because JSON is based on JavaScript object notation syntax. But JSON format is text only, which makes it easy to read and use with any programming language.
    Topics Covered:
    1. How to Serialize an Object or Array of Objects (List of Objects) to JSON?
    2. How to De-serialize a JSON string to C# Object or Array (List of Objects)?
    Dive into the world of C# programming as we unravel the intricacies of JSON serialization and de-serialization in our latest tutorial. Learn how to effortlessly convert JSON to C# class objects, gaining a comprehensive understanding of the process. We'll explore the powerful capabilities of the Newtonsoft.JSON library, equipping you with the skills to seamlessly handle JSON data within your C# applications.
    In this tutorial, we'll demystify the process of reading JSON files in C#, providing you with a step-by-step guide on parsing JSON strings. Whether you're a seasoned developer or just starting with C#, our video covers fundamental aspects, such as C# JSON serialization and de-serialization, ensuring a solid foundation for your coding journey.
    Unlock the potential of C# JSON serialization as we guide you through essential topics, including converting C# objects to JSON strings and vice versa. Discover how to navigate the intricacies of C# JSON parsing, using the library's features to streamline your coding process. Our tutorial delves into the nuances of class-to-JSON string conversion, demonstrating online tools for converting C# classes to JSON effortlessly.
    Moreover, we explore the seamless conversion of strings to JSON in C#, offering valuable insights into the nuances of serializing objects to JSON format. From reading and parsing JSON files to converting JSON to C# objects online, our tutorial ensures you grasp every aspect of working with JSON in a C# environment. Join us on this coding adventure, and elevate your C# skills by mastering the art of JSON manipulation.
    #Json #CSharpTutorial #Newtonsoft
    #csharp #dotnet
    ---------------------------------------------------------------------------------------------
    My setup:
    Mic: amzn.to/44HGe1H
    Laptop: amzn.to/3pclzTe
    Keyboard: amzn.to/3B3e3Nn
    Mouse: amzn.to/3VLKB82

ความคิดเห็น • 15

  • @abdulrafay2420
    @abdulrafay2420 4 หลายเดือนก่อน +2

    Can you please explain why we serializing the json object and how we can store serialized object(string) in the database. Lets suppose we have table of user. I create a post API that creates a user and store in a database how can I use serialization here and what will be the benefit of doing it?

    • @CodewithRSV
      @CodewithRSV  4 หลายเดือนก่อน +1

      Ideally you shouldn't use json string to store your object in db. using entity framework is much better for that. json serialization is better suited for data transfer between API or apps.

    • @abdulrafay2420
      @abdulrafay2420 4 หลายเดือนก่อน +1

      @@CodewithRSV Got it...thanks

    • @abdulrafay2420
      @abdulrafay2420 4 หลายเดือนก่อน

      ​@@CodewithRSV Got it...thanks

  • @manishgarg8371
    @manishgarg8371 10 หลายเดือนก่อน

    very nice explaination

  • @abinayaabi2134
    @abinayaabi2134 5 หลายเดือนก่อน +1

    thank you so much

  • @abubakarizhar5608
    @abubakarizhar5608 23 วันที่ผ่านมา +1

    I can not add System.Text.jso in my VS 2017. Please guide.

    • @CodewithRSV
      @CodewithRSV  23 วันที่ผ่านมา

      @@abubakarizhar5608 what is the target framework of your project?

    • @abubakarizhar5608
      @abubakarizhar5608 23 วันที่ผ่านมา

      @@CodewithRSV .NET 4.8

  • @abhishekbhawankar2971
    @abhishekbhawankar2971 2 หลายเดือนก่อน +1

    Can we create deserialisation in MVC core

    • @CodewithRSV
      @CodewithRSV  2 หลายเดือนก่อน

      @@abhishekbhawankar2971 yes

  • @WebDevWithProfessor
    @WebDevWithProfessor หลายเดือนก่อน

    bro we want c# notes

  • @peremos7781
    @peremos7781 5 หลายเดือนก่อน +1

    How do I deserialize my json when it has a word "producto" before properties?
    {
    "producto": {
    "iDpRODUCTO": 6,
    "codigoBarra": 54323,
    "nombre": "cera",
    "marca": "avon",
    "categoria": "belleza",
    "precio": 3400
    }
    }

    • @CodewithRSV
      @CodewithRSV  5 หลายเดือนก่อน

      Try to de-serialize to Root class:
      // Root myDeserializedClass = JsonConvert.DeserializeObject(myJsonResponse);
      public class Root
      {
      public Producto producto { get; set; }
      }
      public class Producto
      {
      public int iDpRODUCTO { get; set; }
      public int codigoBarra { get; set; }
      public string nombre { get; set; }
      public string marca { get; set; }
      public string categoria { get; set; }
      public int precio { get; set; }
      }

    • @peremos7781
      @peremos7781 5 หลายเดือนก่อน

      @@CodewithRSV thanks, I am using System.Text.Json, can it be done the same?