Conventions 1) If no single reverse relationship and no Attribute is found then it is assumed that relationship is a M:1 i.e. its rev is a 1:M 2) If no single rev rel and 1:1Attribute with no RevRelName then RevRelName = ClassName 3) If no single rev rel and 1:1Att with RevRelName then RevRelName = DeclaredRevRelName 4) If has single rev rel then RevRelName = foundRevRelationshipName Determing RelatedProps if ownerClass.HasProp(RelName+ID) and relatedClass.NotHasProp(RevRelName+ID) owningBOHasForeignKey = true; ownerProp = foundOwnerPropName relatedProp = RelatedClass.ID. if relatedClass.HasProp(reverseRel+ID) and ownerClass.NotHasProp(RelName+ID) owningBOHasForeignKey = false; ownerProp = OwnerClass.Id relatedProp = foundRelatedPropName if ownerClass.HasProp(RelName+ID) and relatedClass.HasProp(RevRelName+ID) if(RelName == relatedClassName) owningBOHasForeignKey = true; ownerProp = foundOwnerClassId relatedProp = foundRelatedPropName Else if ownerClassName LT relatedClassName owningBOHasForeignKey = false; ownerProp = OwnerClassId relatedProp = reverseRelationshipName+ID Else owningBOHasForeignKey = true; ownerProp = RelationshipName+ID relatedProp = RelatedClass.ID
Beispiel #1
0
        ///<summary>
        /// Creates the <see cref="IRelationshipDef"/> from the PropertyWrapper.
        ///</summary>
        ///<param name="propWrapper"></param>
        ///<returns></returns>
        public static IRelationshipDef MapOneToOne(this PropertyWrapper propWrapper)
        {
            if (propWrapper == null)
            {
                return(null);
            }
            OneToOneAutoMapper autoMapper = new OneToOneAutoMapper(propWrapper);

            return(autoMapper.MapOneToOne());
        }
 ///<summary>
 /// Creates the <see cref="IRelationshipDef"/> from the PropertyWrapper.
 ///</summary>
 ///<param name="propWrapper"></param>
 ///<returns></returns>
 public static IRelationshipDef MapOneToOne(this PropertyWrapper propWrapper)
 {
     if (propWrapper == null) return null;
     OneToOneAutoMapper autoMapper = new OneToOneAutoMapper(propWrapper);
     return autoMapper.MapOneToOne();
 }