C# 클래스 EFUtility.CodeGenerationTools.MetadataTools

Responsible for making the Entity Framework Metadata more accessible for code generation.
파일 보기 프로젝트 열기: jradxl/Entity-Framework-Code-Generation-Tools-Experiments 1 사용 예제들

공개 메소드들

메소드 설명
ClrType ( TypeUsage typeUsage ) : Type

This method returns the underlying CLR type of the o-space type corresponding to the supplied typeUsage Note that for an enum type this means that the type backing the enum will be returned, not the enum type itself.

GetCorrespondingDependentProperty ( System.Data.Metadata.Edm.NavigationProperty navProperty, System.Data.Metadata.Edm.EdmProperty principalProperty ) : System.Data.Metadata.Edm.EdmProperty

Given a property on the principal end of a referential constraint, returns the corresponding property on the dependent end. Requires: The association has a referential constraint, and the specified principalProperty is one of the properties on the principal end.

GetCorrespondingPrincipalProperty ( System.Data.Metadata.Edm.NavigationProperty navProperty, System.Data.Metadata.Edm.EdmProperty dependentProperty ) : System.Data.Metadata.Edm.EdmProperty

Given a property on the dependent end of a referential constraint, returns the corresponding property on the principal end. Requires: The association has a referential constraint, and the specified dependentProperty is one of the properties on the dependent end.

GetDependentProperties ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : ReadOnlyMetadataCollection

Gets the collection of properties that are on the dependent end of a referential constraint for the specified navigation property. Requires: The association has a referential constraint.

GetElementType ( TypeUsage typeUsage ) : TypeUsage

If the passed in TypeUsage represents a collection this method returns final element type of the collection, otherwise it returns the value passed in.

GetPrincipalProperties ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : ReadOnlyMetadataCollection

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.

GetSubtypesOf ( EntityType type, ItemCollection itemCollection, bool includeAbstractTypes ) : IEnumerable

Returns the subtype of the EntityType in the current itemCollection

Inverse ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : System.Data.Metadata.Edm.NavigationProperty

Returns the NavigationProperty that is the other end of the same association set if it is available, otherwise it returns null.

IsCascadeDeletePrincipal ( System.Data.Metadata.Edm.AssociationEndMember associationEnd ) : bool

True if the specified association end is the principal in an identifying relationship. or if the association end has cascade delete defined.

IsCascadeDeletePrincipal ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : bool

True if the source end of the specified navigation property is the principal in an identifying relationship. or if the source end has cascade delete defined.

IsIdentifyingRelationship ( System.Data.Metadata.Edm.AssociationType association ) : bool

True if the specified association type is an identifying relationship. In order to be an identifying relationship, the association must have a referential constraint where all of the dependent properties are part of the dependent type's primary key.

IsKey ( System.Data.Metadata.Edm.EdmProperty property ) : bool

True if the EdmProperty is a key of its DeclaringType, False otherwise.

IsNullable ( System.Data.Metadata.Edm.EdmProperty property ) : bool

True if the EdmProperty TypeUsage is Nullable, False otherwise.

IsNullable ( TypeUsage typeUsage ) : bool

True if the TypeUsage is Nullable, False otherwise.

IsPrincipalEndOfIdentifyingRelationship ( System.Data.Metadata.Edm.AssociationEndMember associationEnd ) : bool

True if the specified association end is the principal end in an identifying relationship. In order to be an identifying relationship, the association must have a referential constraint where all of the dependent properties are part of the dependent type's primary key.

IsSubtypeOf ( System.Data.Metadata.Edm.EdmType firstType, System.Data.Metadata.Edm.EdmType secondType ) : bool

requires: firstType is not null effects: if secondType is among the base types of the firstType, return true, otherwise returns false. when firstType is same as the secondType, return false.

MetadataTools ( object textTransformation ) : System

Initializes an MetadataTools Instance with the TextTransformation (T4 generated class) that is currently running

NeedsHandleCascadeDeleteMethod ( ItemCollection itemCollection, EntityType entity ) : bool

True if this entity type requires the HandleCascadeDelete method defined and the method has not been defined on any base type

TryGetStringMetadataPropertySetting ( System.Data.Metadata.Edm.MetadataItem item, string propertyName, string &value ) : bool
UnderlyingClrType ( System.Data.Metadata.Edm.EdmType edmType ) : Type

This method returns the underlying CLR type given the c-space type. Note that for an enum type this means that the type backing the enum will be returned, not the enum type itself.

비공개 메소드들

메소드 설명
ContainsCascadeDeleteAssociation ( ItemCollection itemCollection, EntityType entity ) : bool

True if this entity type participates in any relationships where the other end has an OnDelete cascade delete defined, or if it is the dependent in any identifying relationships

메소드 상세

ClrType() 공개 메소드

This method returns the underlying CLR type of the o-space type corresponding to the supplied typeUsage Note that for an enum type this means that the type backing the enum will be returned, not the enum type itself.
public ClrType ( TypeUsage typeUsage ) : Type
typeUsage TypeUsage
리턴 System.Type

GetCorrespondingDependentProperty() 공개 메소드

Given a property on the principal end of a referential constraint, returns the corresponding property on the dependent end. Requires: The association has a referential constraint, and the specified principalProperty is one of the properties on the principal end.
public GetCorrespondingDependentProperty ( System.Data.Metadata.Edm.NavigationProperty navProperty, System.Data.Metadata.Edm.EdmProperty principalProperty ) : System.Data.Metadata.Edm.EdmProperty
navProperty System.Data.Metadata.Edm.NavigationProperty
principalProperty System.Data.Metadata.Edm.EdmProperty
리턴 System.Data.Metadata.Edm.EdmProperty

GetCorrespondingPrincipalProperty() 공개 메소드

Given a property on the dependent end of a referential constraint, returns the corresponding property on the principal end. Requires: The association has a referential constraint, and the specified dependentProperty is one of the properties on the dependent end.
public GetCorrespondingPrincipalProperty ( System.Data.Metadata.Edm.NavigationProperty navProperty, System.Data.Metadata.Edm.EdmProperty dependentProperty ) : System.Data.Metadata.Edm.EdmProperty
navProperty System.Data.Metadata.Edm.NavigationProperty
dependentProperty System.Data.Metadata.Edm.EdmProperty
리턴 System.Data.Metadata.Edm.EdmProperty

GetDependentProperties() 공개 메소드

Gets the collection of properties that are on the dependent end of a referential constraint for the specified navigation property. Requires: The association has a referential constraint.
public GetDependentProperties ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : ReadOnlyMetadataCollection
navProperty System.Data.Metadata.Edm.NavigationProperty
리턴 ReadOnlyMetadataCollection

GetElementType() 공개 메소드

If the passed in TypeUsage represents a collection this method returns final element type of the collection, otherwise it returns the value passed in.
public GetElementType ( TypeUsage typeUsage ) : TypeUsage
typeUsage TypeUsage
리턴 TypeUsage

GetPrincipalProperties() 공개 메소드

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
리턴 ReadOnlyMetadataCollection

GetSubtypesOf() 공개 메소드

Returns the subtype of the EntityType in the current itemCollection
public GetSubtypesOf ( EntityType type, ItemCollection itemCollection, bool includeAbstractTypes ) : IEnumerable
type System.Data.Metadata.Edm.EntityType
itemCollection ItemCollection
includeAbstractTypes bool
리턴 IEnumerable

Inverse() 공개 메소드

Returns the NavigationProperty that is the other end of the same association set if it is available, otherwise it returns null.
public Inverse ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : System.Data.Metadata.Edm.NavigationProperty
navProperty System.Data.Metadata.Edm.NavigationProperty
리턴 System.Data.Metadata.Edm.NavigationProperty

IsCascadeDeletePrincipal() 공개 메소드

True if the specified association end is the principal in an identifying relationship. or if the association end has cascade delete defined.
public IsCascadeDeletePrincipal ( System.Data.Metadata.Edm.AssociationEndMember associationEnd ) : bool
associationEnd System.Data.Metadata.Edm.AssociationEndMember
리턴 bool

IsCascadeDeletePrincipal() 공개 메소드

True if the source end of the specified navigation property is the principal in an identifying relationship. or if the source end has cascade delete defined.
public IsCascadeDeletePrincipal ( System.Data.Metadata.Edm.NavigationProperty navProperty ) : bool
navProperty System.Data.Metadata.Edm.NavigationProperty
리턴 bool

IsIdentifyingRelationship() 공개 메소드

True if the specified association type is an identifying relationship. In order to be an identifying relationship, the association must have a referential constraint where all of the dependent properties are part of the dependent type's primary key.
public IsIdentifyingRelationship ( System.Data.Metadata.Edm.AssociationType association ) : bool
association System.Data.Metadata.Edm.AssociationType
리턴 bool

IsKey() 공개 메소드

True if the EdmProperty is a key of its DeclaringType, False otherwise.
public IsKey ( System.Data.Metadata.Edm.EdmProperty property ) : bool
property System.Data.Metadata.Edm.EdmProperty
리턴 bool

IsNullable() 공개 메소드

True if the EdmProperty TypeUsage is Nullable, False otherwise.
public IsNullable ( System.Data.Metadata.Edm.EdmProperty property ) : bool
property System.Data.Metadata.Edm.EdmProperty
리턴 bool

IsNullable() 공개 메소드

True if the TypeUsage is Nullable, False otherwise.
public IsNullable ( TypeUsage typeUsage ) : bool
typeUsage TypeUsage
리턴 bool

IsPrincipalEndOfIdentifyingRelationship() 공개 메소드

True if the specified association end is the principal end in an identifying relationship. In order to be an identifying relationship, the association must have a referential constraint where all of the dependent properties are part of the dependent type's primary key.
public IsPrincipalEndOfIdentifyingRelationship ( System.Data.Metadata.Edm.AssociationEndMember associationEnd ) : bool
associationEnd System.Data.Metadata.Edm.AssociationEndMember
리턴 bool

IsSubtypeOf() 공개 메소드

requires: firstType is not null effects: if secondType is among the base types of the firstType, return true, otherwise returns false. when firstType is same as the secondType, return false.
public IsSubtypeOf ( System.Data.Metadata.Edm.EdmType firstType, System.Data.Metadata.Edm.EdmType secondType ) : bool
firstType System.Data.Metadata.Edm.EdmType
secondType System.Data.Metadata.Edm.EdmType
리턴 bool

MetadataTools() 공개 메소드

Initializes an MetadataTools Instance with the TextTransformation (T4 generated class) that is currently running
public MetadataTools ( object textTransformation ) : System
textTransformation object
리턴 System

NeedsHandleCascadeDeleteMethod() 공개 메소드

True if this entity type requires the HandleCascadeDelete method defined and the method has not been defined on any base type
public NeedsHandleCascadeDeleteMethod ( ItemCollection itemCollection, EntityType entity ) : bool
itemCollection ItemCollection
entity System.Data.Metadata.Edm.EntityType
리턴 bool

TryGetStringMetadataPropertySetting() 공개 정적인 메소드

public static TryGetStringMetadataPropertySetting ( System.Data.Metadata.Edm.MetadataItem item, string propertyName, string &value ) : bool
item System.Data.Metadata.Edm.MetadataItem
propertyName string
value string
리턴 bool

UnderlyingClrType() 공개 메소드

This method returns the underlying CLR type given the c-space type. Note that for an enum type this means that the type backing the enum will be returned, not the enum type itself.
public UnderlyingClrType ( System.Data.Metadata.Edm.EdmType edmType ) : Type
edmType System.Data.Metadata.Edm.EdmType
리턴 System.Type