private void MapStructuralType(StructuralTypeConfiguration structuralType)
        {
            IEnumerable <PropertyInfo> properties = ConventionsHelpers.GetProperties(structuralType, includeReadOnly: _isQueryCompositionMode);

            foreach (PropertyInfo property in properties)
            {
                bool isCollection;
                IEdmTypeConfiguration mappedType;

                PropertyKind propertyKind = GetPropertyType(property, out isCollection, out mappedType);

                if (propertyKind == PropertyKind.Primitive || propertyKind == PropertyKind.Complex || propertyKind == PropertyKind.Enum)
                {
                    MapStructuralProperty(structuralType, property, propertyKind, isCollection);
                }
                else if (propertyKind == PropertyKind.Dynamic)
                {
                    structuralType.AddDynamicPropertyDictionary(property);
                }
                else if (propertyKind == PropertyKind.InstanceAnnotations)
                {
                    structuralType.AddInstanceAnnotationContainer(property);
                }
                else
                {
                    // don't add this property if the user has already added it.
                    if (structuralType.NavigationProperties.All(p => p.Name != property.Name))
                    {
                        NavigationPropertyConfiguration addedNavigationProperty;
                        if (!isCollection)
                        {
                            addedNavigationProperty = structuralType.AddNavigationProperty(property, EdmMultiplicity.ZeroOrOne);
                        }
                        else
                        {
                            addedNavigationProperty = structuralType.AddNavigationProperty(property, EdmMultiplicity.Many);
                        }

                        ContainedAttribute containedAttribute = property.GetCustomAttribute <ContainedAttribute>();
                        if (containedAttribute != null)
                        {
                            addedNavigationProperty.Contained();
                        }

                        addedNavigationProperty.AddedExplicitly = false;
                    }
                }
            }

            MapDerivedTypes(structuralType);
        }
        internal NavigationPropertyConfiguration GetOrCreateNavigationProperty(Expression navigationPropertyExpression, EdmMultiplicity multiplicity)
        {
            PropertyInfo navigationProperty = PropertySelectorVisitor.GetSelectedProperty(navigationPropertyExpression);

            return(_configuration.AddNavigationProperty(navigationProperty, multiplicity));
        }