Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top