This is a migrated thread and some comments may be shown as answers.

AssociationsPart property

1 Answer 44 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wolfgang
Top achievements
Rank 1
Wolfgang asked on 24 Sep 2014, 08:51 AM
Hi

According to 
http://docs.telerik.com/data-access/feature-reference/api/data-access-metadata/metadata-types/conceptual-types/metadata-metadata-types-meta-association

it should be possible to access a table columns for an association via AssociationsPart.

I tried to access navigationmember.Association.AssociationParts - but it seems to be private, so i cannot access it. 
The Navigationmember has no Constraint, so i cannot get the column via contraint either.

What would be a way to get the column name in this case?

foreach (MetaMember mm in persistenType.Members)
MetaNavigationMember navigationMember = member as MetaNavigationMember;
if(member != null) 
mm.Associataion. ?

Best regards
Wolfgang

1 Answer, 1 is accepted

Sort by
0
Accepted
Boris Georgiev
Telerik team
answered on 29 Sep 2014, 06:51 AM
Hi Wolfgang,

Yes, the AssociationParts are internal and cannot be accessed directly from the MetaAssociation.

To get the AssociationParts from MetaNavigationMember you should use the MetadataWorker with the static method GetAssociationPartsForAssociation:
1.var association = nav.Association as MetaAssociation;
2.var associationParts = MetadataWorker.GetAssociationPartsForAssociation(association, AssociationPartType.ForeignKey);

I hope that helps.

Regards,
Boris Georgiev
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Development (API, general questions)
Asked by
Wolfgang
Top achievements
Rank 1
Answers by
Boris Georgiev
Telerik team
Share this question
or