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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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