AssociationsPart property

Thread is closed for posting
2 posts, 1 answers
  1. Wolfgang
    Wolfgang avatar
    98 posts
    Member since:
    Oct 2012

    Posted 24 Sep 2014 Link to this post


    According to

    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

  2. Answer
    Boris Georgiev
    Boris Georgiev avatar
    190 posts

    Posted 29 Sep 2014 Link to this post

    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.

    Boris Georgiev
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top