How to do Reflection of structure?

How to do Reflection of structure?

  

Hi All,


I'm trying to make an extension to do some reflection process. basically I'm passing an object as input parameter, and the extension will return list of the object properties' name and value.


The question is, 

my code is working if I pass an object instance of entity, but if I use object instance of a structure it's not working.


This is my code:

public void MssGetPropertyInfoList(object ssObjectData, out RLPropertyInfoRecordList ssPropertyInfoList, out string ssTest)
        {

foreach (var propInfo in ssObjectData.GetType().GetProperties())
            {
                ssTest += propInfo.Name + ":" + propInfo.GetValue(ssObjectData).ToString() + ">> ";
            }

}

If I passed a "Contact" entity into ObjectData

ssTest will return correct string, something like:

Tenant_Id:0>> ssId:0>> ssName:Gunthe>> ssPhoneNumber:123132>> ssAddress:aaaaaa>> AllOptimizedAttributes:System.Collections.BitArray[]>>


but if passed a "DataStructure" structure into ObjectData

ssTest will only return AllOptimizedAttributes:System.Collections.BitArray[]>> 


I'm trying to get something like ssRecipientName:SomeName>> ssTaskName:XXYYZZ>>

What is actually I'm missing here?


Service Studio version: 10.0.613.0

Integration Studio version: 10.0.604.0


Thanks,

Dan

I suggest to check other forge-components how they do it.