Hi sanket.raj8,
I think I understand what you want. But I don't see where you possibly have been stuck. It seems quite a managable task for you because you mentioned you already found out that your
mainArray
property is an Array.
Anyway - so you have a method/function like this:
public static bool HasAtLeastOneArrayProperty(object obj)
{
PropertyInfo[] aPropertyInfos = obj.GetType().GetProperties();
return aPropertyInfos.Any(p => p.PropertyType.IsArray);
}
Now if you want to go down the complete object graph (be aware of "reference circles"), you should be able to just do recursive calls to this methods for every property and their subproperties and so on. (Or was your intention to ask whether you can avoid that?)
Sounds like a "unusual" requirement - I'm shure you have good reasons for it - just wondering why want to do this? Can you enlighten me?
If you have any further/other problems feel free to ask me - Maybe I can REFLECT on some of my memories and help you out.
Kind regards
Johannes