I wrote a little console app that is supposed to write out properties for a given class.
It works on "normal" classes, but it just shows a blank list when I try and pass in a NHibernate classMapping class.
Stepping through the debugger in Visual Studio, I just see empty values and one, non-show stopping error: "No further information on this object could be discovered."
Is there a way to get the parameters/properties used in a ClassMapping class?
Thanks!
Mapping class:
public class CorporateDataMapping : ClassMapping<CorporateData>
{
public CorporateDataMapping()
{
Schema("data");
this.EnhancedSequenceId(x => x.Id);
ManyToOne(x => x.CEO, pm => pm.NotNullable(true));
Property(x => x.Sign, pm => pm.NotNullable(true));
Property(x => x.WeatherType, pm => pm.NotNullable(true));
Property(x => x.EncodingLanguage);
Property(x => x.ZipCode);
Property(x => x.PhysicalLocation);
Property(x => x.Extension, pm => pm.NotNullable(true));
Property(x => x.DisplayAllYear, pm => pm.NotNullable(true));
Property(x => x.Graphics, pm => pm.NotNullable(true));
Property(x => x.InstallDate, pm => pm.NotNullable(true));
}
}
Program that is suppposed to display all properties of the class:
static void Main(string[] args)
{
CorporateDataMapping mapping = new CorporateDataMapping();
printProperties(mapping);
Console.ReadLine();
}
public static void printProperties(Object jsonObject)
{
JObject json = JObject.FromObject(jsonObject);
Console.WriteLine("Classname: {0}\n", jsonObject.ToString());
Console.WriteLine("{0,-20} {1,5}\n", "Name", "Value");
foreach (JProperty property in json.Properties()) {
Console.WriteLine("{0,-20} {1,5:N1}", property.Name, property.Value);
}
}
}