dimanche 21 décembre 2014

How to use where clause (Pass parameter value) in MiniJSON

I have 2 array names called categories and products and i'm getting the values from products table but i want to pass the id value from categories to products using WHERE clause. But how can i use WHERE in MiniJSON?



{"Categories":[{"id":"1","name":"Test1"},{"id":"2","name":"Test2"},}],

"Products":
[{"name":"Test2","category_id":"2","imageurl":"http://ift.tt/1CnaxtO"},
{"name":"Test1","category_id":"1","imageurl":"http://ift.tt/1Ho2sDr"},]}


IList linksObject = (IList) search["Products"]

foreach (IDictionary ProductslinksArray in linksObject) {

String modal3d=string.Format("{0} ", ProductslinksArray["imageurl"]);

//Here i need to pass the id value from categories to products WHERE category_id=? (id value ) How can i use WHERE clause?

I have tried below

String cat_id=string.Format("{0} ", modellinksArray["category_id"]);

String modal3d=string.Format("{0} ", modellinksArray["imageurl"] as cat_id["1"]);

}

Aucun commentaire:

Enregistrer un commentaire