EFUtility.CodeGenerationTools.MetadataTools.GetPrincipalProperties C# (CSharp) Method

GetPrincipalProperties() public method

Gets the collection of properties that are on the principal end of a referential constraint for the specified navigation property. Requires: The association has a referential constraint.
public GetPrincipalProperties ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : ReadOnlyMetadataCollection
navProperty System.Data.Metadata.Edm.NavigationProperty
return ReadOnlyMetadataCollection
        public ReadOnlyMetadataCollection<EdmProperty> GetPrincipalProperties(NavigationProperty navProperty)
        {
            if (navProperty == null)
            {
                throw new ArgumentNullException("navProperty");
            }

            return ((AssociationType)navProperty.RelationshipType).ReferentialConstraints[0].FromProperties;
        }