Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

work with array in object array

Tags:

arrays

c#

object

How can i work with Array in Object Array

Please see picture for more info :

enter image description hereenter image description here I use from forech for get Object and then i want to work with Array in Object but it's not possible

foreach (object element in result)

I want to get value from array and work with them for example i want to get "TestCategory_1" or etc but i can't

now how can i work with value like this ?

Kind regards

like image 539
Sam Avatar asked Oct 05 '22 06:10

Sam


1 Answers

it seems that elements from result are of type IDictionary. Try with this:

foreach (IDictionary element in result)
{
    var testCategory = element["categoryName"];
}
like image 92
Stipo Avatar answered Oct 10 '22 23:10

Stipo