As discussed in support thread 760102, Telerik OpenAccess ORM allows you to examine the associations related to a given persistent type and to precisely determine the foreign key property a given association depends on.
In order to achieve that, you would be using the metadata types
supported by OpenAccess ORM. Additionally, the following sample workflow was suggested:
(EntitiesModel dbContext =
//Retrieves the associations in which a given type is the child type
IEnumerable<MetaAssociation> associations = dbContext.Metadata.Associations.Where(t => t.Source.Name == type.Name);
//Retrieves a list of members that represent the foreign key properties of the class
IList<MetaPrimitiveMember> keys = association.GetSourceConceptualKeys();
With it, you can filter the associations in the model and can extract the foreign key properties of a given type that participate in a given association.
I hope you find this feasible. I am looking forward to your feedback.
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features
shipped with our latest release!