0

I have a json list and I have a type named post. I want to use it for search.

I want to get a list or one object with a query. Is that possible ?

Example part of json

{
  "Post": [
    {
      "id":"22",
      "text":"Dream Big",
      "img":"a2ca3cf9-664e-4d92-80f1-df20e971b7c0.jpg",
      "catid":"12",
      "meta_title":"Dream Big Design",
      "content":"some text",
      "user_id":"5556",
    }
    {
      "id":"24",
      "text":"Handmade Resin",
      "img":"423233-971b7c0.jpg",
      "catid":"7",
      "meta_title":"Handmade Resin",
      "content":"some text",
      "user_id":"1256",
    }
  ]
}

I want to select id = 23 or name like 'handmade'.

I tried with this code but it did not work

string json = System.IO.File.ReadAllText(path + "output.json");
var serializer = new JavaScriptSerializer();

Post post = JsonConvert.DeserializeObject<Post>(json);
ZwoRmi
  • 1,093
  • 11
  • 30
serdar
  • 454
  • 1
  • 8
  • 26

1 Answers1

0

you can use JObject in the C# that can parse the Json object and then you can fire your Select query.

JObject jObject = JObject.Parse(your Json object in string);

Yagnesh Khamar
  • 184
  • 3
  • 8