This question is locked. New answers and comments are not allowed.
Hello,
I am trying to get the Primary / Identify Field PropertyName to be used in dynamic Query. I tried following code
IPersistentTypeDescriptor ptd = scope.PersistentMetaData.GetPersistentTypeDescriptor(typeof(T));
PropertyDescriptorCollection pdc = ptd.GetProperties();
foreach (var item in ptd.IdentityFields)
{
sPrimaryKey = item.Name.ToString();
break;
}
But this is giving the field name instead of Actual properly name holding the primary key.
Please advise how to get that.
Thanks