C# 클래스 Breeze.PocoMetadata.EntityDescriptor

Describes the metadata for a set of entities. The PocoMetadataBuilder calls methods on this class to determine how to generate metadata for the entities. Extend this class to adapt to your data model.
파일 보기 프로젝트 열기: Breeze/breeze.tooling 1 사용 예제들

공개 메소드들

메소드 설명
GetAutoGeneratedKeyType ( Type type ) : string

Get the autoGeneratedKeyType value for the given type. Should be defined even if the actual key property is on a base type.

GetDataPropertyType ( Type type, PropertyInfo propertyInfo ) : Type

Change the type of the given data property in the metadata. For example, a custom wrapper type on the server may be unwrapped on the client, and the metadata reflects this.

GetForeignKeyName ( Type type, PropertyInfo propertyInfo ) : string

Get the foreign key for the given scalar navigation property. This is another property on the same entity that establishes the foreign key relationship.

GetMissingFKHandling ( Type type, PropertyInfo propertyInfo ) : MissingKeyHandling

Determine the generator behaves if a foreign key data property cannot be found for the given navigation property.

GetMissingPKHandling ( Type type ) : MissingKeyHandling

Determine the generator behaves if a primary key is missing on an entity.

GetResourceName ( Type type ) : string

Get the server resource name (endpoint) for the given type. E.g. for entity type Product, it might be "Products". This value is used by Breeze client when composing a query URL for an entity.

Include ( Type type ) : bool

Filter types from metadata generation.

IsComplexType ( Type type ) : bool

Determine if the given type is a "Complex Type" instead of an "Entity". Complex Types are sometimes called component types or embedded types, because they are part of the parent entity instead of being related by foreign keys.

IsKeyProperty ( Type type, PropertyInfo propertyInfo ) : bool

Determine if the property is part of the entity key.

IsVersionProperty ( Type type, PropertyInfo propertyInfo ) : bool

Determine if the property is a version property used for optimistic concurrency control.

Pluralize ( string s ) : string

Lame pluralizer. Assumes we just need to add a suffix. Consider using System.Data.Entity.Design.PluralizationServices.PluralizationService.

Replace ( Type type, IEnumerable types ) : Type

Replace the given type wherever it appears in the metadata. Can be used to replace an interface with a class.

메소드 상세

GetAutoGeneratedKeyType() 공개 메소드

Get the autoGeneratedKeyType value for the given type. Should be defined even if the actual key property is on a base type.
public GetAutoGeneratedKeyType ( Type type ) : string
type System.Type Entity type for which metadata is being generated
리턴 string

GetDataPropertyType() 공개 메소드

Change the type of the given data property in the metadata. For example, a custom wrapper type on the server may be unwrapped on the client, and the metadata reflects this.
public GetDataPropertyType ( Type type, PropertyInfo propertyInfo ) : Type
type System.Type Entity type for which metadata is being generated
propertyInfo System.Reflection.PropertyInfo Property being considered
리턴 System.Type

GetForeignKeyName() 공개 메소드

Get the foreign key for the given scalar navigation property. This is another property on the same entity that establishes the foreign key relationship.
public GetForeignKeyName ( Type type, PropertyInfo propertyInfo ) : string
type System.Type Entity type for which metadata is being generated
propertyInfo System.Reflection.PropertyInfo Scalar navigation/association property
리턴 string

GetMissingFKHandling() 공개 메소드

Determine the generator behaves if a foreign key data property cannot be found for the given navigation property.
public GetMissingFKHandling ( Type type, PropertyInfo propertyInfo ) : MissingKeyHandling
type System.Type Entity type for which metadata is being generated
propertyInfo System.Reflection.PropertyInfo Scalar navigation/association property
리턴 MissingKeyHandling

GetMissingPKHandling() 공개 메소드

Determine the generator behaves if a primary key is missing on an entity.
public GetMissingPKHandling ( Type type ) : MissingKeyHandling
type System.Type Entity type for which metadata is being generated
리턴 MissingKeyHandling

GetResourceName() 공개 메소드

Get the server resource name (endpoint) for the given type. E.g. for entity type Product, it might be "Products". This value is used by Breeze client when composing a query URL for an entity.
public GetResourceName ( Type type ) : string
type System.Type Entity type for which metadata is being generated
리턴 string

Include() 공개 메소드

Filter types from metadata generation.
public Include ( Type type ) : bool
type System.Type
리턴 bool

IsComplexType() 공개 메소드

Determine if the given type is a "Complex Type" instead of an "Entity". Complex Types are sometimes called component types or embedded types, because they are part of the parent entity instead of being related by foreign keys.
public IsComplexType ( Type type ) : bool
type System.Type Entity type for which metadata is being generated
리턴 bool

IsKeyProperty() 공개 메소드

Determine if the property is part of the entity key.
public IsKeyProperty ( Type type, PropertyInfo propertyInfo ) : bool
type System.Type Entity type for which metadata is being generated
propertyInfo System.Reflection.PropertyInfo Property being considered
리턴 bool

IsVersionProperty() 공개 메소드

Determine if the property is a version property used for optimistic concurrency control.
public IsVersionProperty ( Type type, PropertyInfo propertyInfo ) : bool
type System.Type Entity type for which metadata is being generated
propertyInfo System.Reflection.PropertyInfo Property being considered
리턴 bool

Pluralize() 공개 메소드

Lame pluralizer. Assumes we just need to add a suffix. Consider using System.Data.Entity.Design.PluralizationServices.PluralizationService.
public Pluralize ( string s ) : string
s string String to pluralize
리턴 string

Replace() 공개 메소드

Replace the given type wherever it appears in the metadata. Can be used to replace an interface with a class.
public Replace ( Type type, IEnumerable types ) : Type
type System.Type Type to replace
types IEnumerable List of available types provided to the PocoMetadataBuilder
리턴 System.Type