C# 클래스 Habanero.Smooth.OneToOneAutoMapper

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
파일 보기 프로젝트 열기: Chillisoft/habanero.smooth 1 사용 예제들

Private Properties

프로퍼티 타입 설명
CheckReverseRelationshipValid void
FKFoundOnOwnerClass bool
FKFoundOnRelatedClass bool
GetDeleteAction DeleteParentAction
GetFkPropName string
IsDefinedAsAssociation bool
IsDefinedAsCompositionOrAggregation bool
IsDefinedAsCompositionOrAggregation bool
OwnerClassNameGTRelatedClassName bool
ReverseRelationshipIsDefinedAsAggregationOrComposition bool
SetRelationshipType void

공개 메소드들

메소드 설명
CreateRelPropDef ( ) : IRelPropDef

Create a RelPropDef based on the OwningPrropName and the RelatedPropName.

GetOwningPropName ( ) : string

Using a set of heuristics the Owning Property Name is determined from the RelationshipName and any attributes on the Property. I.e. The Property of the class that owns this One To One Relationship. I.e. The Property on the Class that owns the Property that wrapped by the PropertyWrapper.

GetRelatedPropName ( ) : string

Using a set of heuristics the Related Property Name is determined from the RelationshipName and any attributes on the Property. I.e. The Property of the class that is related by One To One Relationship. I.e. The Property on the Class that is returned by the Property that is wrapped by the PropertyWrapper.

MapOneToOne ( ) : IRelationshipDef

Maps the ReflectionWrappers.PropertyWrapper to a IRelationshipDef.

MustBeMapped ( ) : bool

Determines based on heuristics whether the Property wrapped by the ReflectionWrappers.PropertyWrapper must be mapped to a One to One Relationship or not

OneToOneAutoMapper ( PropertyWrapper propWrap ) : System

Construct a One to One Relationship mapper.

비공개 메소드들

메소드 설명
CheckReverseRelationshipValid ( ) : void
FKFoundOnOwnerClass ( ) : bool
FKFoundOnRelatedClass ( ) : bool
GetDeleteAction ( ) : DeleteParentAction
GetFkPropName ( string relationshipName ) : string
IsDefinedAsAssociation ( ) : bool

If this relationship is defined (I.e. defined via an attribute) as Association then return true.

IsDefinedAsCompositionOrAggregation ( ) : bool
IsDefinedAsCompositionOrAggregation ( PropertyWrapper propertyWrapper ) : bool

If the propertyWrapper is defined as Composition or Aggregation via attributes then return true.

OwnerClassNameGTRelatedClassName ( TypeWrapper ownerClassType, TypeWrapper relatedClassType ) : bool
ReverseRelationshipIsDefinedAsAggregationOrComposition ( ) : bool

If the reverse relationship is defined as Composition or Aggregation via attributes then return true.

SetRelationshipType ( SingleRelationshipDef relDef ) : void

메소드 상세

CreateRelPropDef() 공개 메소드

Create a RelPropDef based on the OwningPrropName and the RelatedPropName.
public CreateRelPropDef ( ) : IRelPropDef
리턴 IRelPropDef

GetOwningPropName() 공개 메소드

Using a set of heuristics the Owning Property Name is determined from the RelationshipName and any attributes on the Property. I.e. The Property of the class that owns this One To One Relationship. I.e. The Property on the Class that owns the Property that wrapped by the PropertyWrapper.
public GetOwningPropName ( ) : string
리턴 string

GetRelatedPropName() 공개 메소드

Using a set of heuristics the Related Property Name is determined from the RelationshipName and any attributes on the Property. I.e. The Property of the class that is related by One To One Relationship. I.e. The Property on the Class that is returned by the Property that is wrapped by the PropertyWrapper.
public GetRelatedPropName ( ) : string
리턴 string

MapOneToOne() 공개 메소드

Maps the ReflectionWrappers.PropertyWrapper to a IRelationshipDef.
public MapOneToOne ( ) : IRelationshipDef
리턴 IRelationshipDef

MustBeMapped() 공개 메소드

Determines based on heuristics whether the Property wrapped by the ReflectionWrappers.PropertyWrapper must be mapped to a One to One Relationship or not
public MustBeMapped ( ) : bool
리턴 bool

OneToOneAutoMapper() 공개 메소드

Construct a One to One Relationship mapper.
public OneToOneAutoMapper ( PropertyWrapper propWrap ) : System
propWrap PropertyWrapper
리턴 System