D
D
Deka0072019-08-02 19:43:04
JSON
Deka007, 2019-08-02 19:43:04

Object not reading data from json file?

In the picture, the whole point and the problem, where did I mess it up?
5d446720446e0346752358.png

namespace RSSConsole
{

    public class RssLinks
    {
      
        public string name { get; set; }
        public string age { get; set; }
        public string[] cars { get; set; }

    }
}

namespace RSSConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var obj = JsonConvert.DeserializeObject<RssLinks>(File.ReadAllText("Person.json"));
            Console.ReadKey();
        }
    }
}

person.json
{
  "name": "John",
  "age": 30,
  "cars":  ["Ford", "Mazda"]
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Deka007, 2019-08-02
@Deka007

5d4477ffed263180927016.pngIt's decided.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question