0

I have Added Persistent Class in in my webapplication. It contains 20 classes..,

In my Default.aspx.cs, I want to get list of Primary key name from all classes in Persistent class.. How can i find it?

Filip
  • 3,257
  • 2
  • 22
  • 38
ghanshyam.mirani
  • 3,075
  • 11
  • 45
  • 85

1 Answers1

2

I assumed that you use XPO:

foreach (XPClassInfo classInfo in xpoSession.Dictionary.Classes)
{
    Console.WriteLine(classInfo.FullName + "=" + classInfo.KeyProperty);
}

If you have simple primary key, use classInfo.KeyProperty.Name to fetch its name.

Filip
  • 3,257
  • 2
  • 22
  • 38