I am new to C# and have investigated without success. I come from programming in PHP and I have the following JSON:
{"data": [
{ "iD":0 , "name":"woody", "a":4.0, "b": 3.5, "foo": [5,8] },
{ "iD":1 , "name":"donald", "a":5.0, "b": 2.4, "foo": [4, 2] }
]}
What I need is to create something similar in C#, if possible in a separate class to be able to access the data in the correct way. I tried to create a different array for each item but I think it is not correct.
From what I've researched, based on the JSON I've presented as an example, I have the following data types: "string, int and double". In PHP you can mix this type of data in the same array and call it through indexes but I don't know exactly how to do the same in C #.
Eye, my question is not how to read the JSON that I have put above, but how to create an similar array (or an object) with that data structure and that I can access it from another class.
I hope I was clear, thanks in advance.
dataObject.nameyou get a string and can perform any string-operation, whereas if you would apply any math on that string you´d get a compiler-error. You should definitly read about the basic concepts of C#.