Beispiel #1
0
 public CustomNavigationPropertyType(
     string[] nestedComplexTypePropertyPath,
     PropertyInfo clrPropertyInfo,
     bool isNullable,
     bool isReadOnly,
     CustomRelationshipEndType from,
     CustomRelationshipEndType to
     )
     : base(nestedComplexTypePropertyPath, clrPropertyInfo, isNullable, isReadOnly)
 {
     _from = from;
     _to   = to;
 }
Beispiel #2
0
        GetEntityNavigationProperties(
            Type clrObjectType,
            ICollection <EntityMemberCandidate> candidateList,
            ICollection <DeferredRelationshipMetadata> deferredRelationships
            )
        {
            var collectedNavidationProperties = new List <CustomNavigationPropertyType>();
            var candidateArray = candidateList.ToArray();

            foreach (var navigationPropertyCandidate in candidateArray)
            {
                var navigationPropertyAttribute =
                    TryGetAttribute <CustomNavigationPropertyAttribute>(
                        navigationPropertyCandidate.ClrProperty
                        );

                if (null == navigationPropertyAttribute)
                {
                    continue;
                }

                CustomRelationshipEndType from = new CustomRelationshipEndType();
                CustomRelationshipEndType to   = new CustomRelationshipEndType();

                CustomNavigationPropertyType navigationProperty =
                    new CustomNavigationPropertyType(
                        navigationPropertyCandidate.NestedComplexTypePropertyPath,
                        navigationPropertyCandidate.ClrProperty,
                        navigationPropertyAttribute.IsNullable,
                        navigationPropertyAttribute.IsReadOnly,

                        from,
                        to
                        );

                collectedNavidationProperties.Add(navigationProperty);
                candidateList.Remove(navigationPropertyCandidate);

                deferredRelationships.Add(
                    new DeferredRelationshipMetadata(
                        clrObjectType,
                        navigationPropertyAttribute,
                        navigationProperty
                        )
                    );
            }

            return(collectedNavidationProperties);
        }