I have a very simple object like:
public class ChargeTemplate
{
public string ChargeTemplateType;
public string TemplateCode;
public string ChargeDescription;
public string Active;
public Calculation ChargeTemplateCalculation;
public TApplication ChargeTemplateApplication;
public Taxation ChargeTemplateTaxation;
}
I'm filling out some of the fields and then passing it to this method:
public void FillChargeTemplateFields(object items)
{
foreach (var prop in items.GetType().GetFields())
{
...
}
}
Inside I'm grabbing the name and the value.
When I get down to Calculation, I want to know that it's a new class with fields so that I can throw it back up into the method to get it's field names and values. But I can't seem to figure out how to determine that it's a class as well. How do I do this?