Manikandan R

Manikandan R

  • 1.6k
  • 166
  • 4.7k

How to deserialize json data using C#

Mar 31 2023 5:57 AM

Hi,

I need to deserialize the blow json data to class list in c#.

[
    {
        "M1": [
            {
                "Machine Data": {
                    "Date": "20-02-2023",
                    "Time": "09:16:41",
                    "IP Number": "-",
                    "Machine Number": "M1",
                    "Machine Name": "M1",
                    "Machine Status": "0",
                    "Program Name": "-",
                    "Part Count": "1",
                    "Power on Time": "1",
                    "Running Time": "1",
                    "Breakdown Time": "1",
                    "Idle Time": "1"
                },
                "SP Data":  [
                    {
                        "Orders": {
                            "Client ID": "1",
                            "Order Number": "123",
                            "Order Quantity": "3",
                            "Material Code": "123",
                            "Produced Quantity": "1"
                        }
                    },
                    {
                        "Orders": {
                            "Client ID": "2",
                            "Order Number": "1234",
                            "Order Quantity": "4",
                            "Material Code": "123",
                            "Produced Quantity": "2"
                        }
                    },
                    {
                        "Orders": {
                            "Client ID": "2",
                            "Order Number": "1234",
                            "Order Quantity": "4",
                            "Material Code": "123",
                            "Produced Quantity": "2"
                        }
                    }
                ]
            }
        ]
    }
]

 


Answers (6)