EntityTypeExtensions Class

Definition

Caution

Use IReadOnlyEntityType

Entity type extension methods for IReadOnlyEntityType.

public static class EntityTypeExtensions
[System.Obsolete("Use IReadOnlyEntityType")]
public static class EntityTypeExtensions
type EntityTypeExtensions = class
[<System.Obsolete("Use IReadOnlyEntityType")>]
type EntityTypeExtensions = class
Public Module EntityTypeExtensions
Inheritance
EntityTypeExtensions
Attributes

Methods

DisplayName(ITypeBase)

Gets the friendly display name for the given ITypeBase.

FindDeclaredNavigation(IEntityType, String)

Gets a navigation property on the given entity type. Does not return navigation properties defined on a base type. Returns null if no navigation property is found.

FindDeclaredProperty(IEntityType, String)

Finds a property declared on the type with the given name. Does not return properties defined on a base type.

FindDefiningNavigation(IEntityType)
Obsolete.

Returns the defining navigation if one exists or null otherwise.

FindForeignKey(IEntityType, IProperty, IKey, IEntityType)

Gets the foreign key for the given properties that points to a given primary or alternate key. Returns null if no foreign key is found.

FindForeignKeys(IEntityType, IProperty)

Gets the foreign keys defined on the given property. Only foreign keys that are defined on exactly the specified property are returned. Composite foreign keys that include the specified property are not returned.

FindForeignKeys(IEntityType, IReadOnlyList<IProperty>)

Gets the foreign keys defined on the given properties. Only foreign keys that are defined on exactly the specified set of properties are returned.

FindIndex(IEntityType, IProperty)

Gets the unnamed index defined on the given property. Returns null if no such index is defined.

Named indexes will not be returned even if the list of properties matches.

FindKey(IEntityType, IProperty)

Gets the primary or alternate key that is defined on the given property. Returns null if no key is defined for the given property.

FindNavigation(IEntityType, MemberInfo)

Gets a navigation property on the given entity type. Returns null if no navigation property is found.

FindNavigation(IEntityType, PropertyInfo)

Gets a navigation property on the given entity type. Returns null if no navigation property is found.

FindNavigation(IEntityType, String)

Gets a navigation property on the given entity type. Returns null if no navigation property is found.

FindOwnership(IEntityType)

Returns the relationship to the owner if this is an owned type or null otherwise.

FindProperties(IEntityType, IReadOnlyList<String>)

Finds matching properties on the given entity type. Returns null if any property is not found.

This API only finds scalar properties and does not find navigation properties.

FindProperty(IEntityType, MemberInfo)

Gets a property with the given member info. Returns null if no property is found.

This API only finds scalar properties and does not find navigation properties. Use FindNavigation(IEntityType, MemberInfo) to find a navigation property.

FindProperty(IEntityType, PropertyInfo)

Gets a property on the given entity type. Returns null if no property is found.

This API only finds scalar properties and does not find navigation properties. Use FindNavigation(IEntityType, PropertyInfo) to find a navigation property.

FullName(ITypeBase)
Obsolete.

Gets the unique name for the given IReadOnlyTypeBase.

GetAllBaseTypes(IEntityType)

Gets all types in the model from which a given entity type derives, starting with the root.

GetAllBaseTypesAscending(IEntityType)

Gets all types in the model from which a given entity type derives, starting with the closest one.

GetAllBaseTypesInclusive(IEntityType)

Returns all base types of the given IEntityType, including the type itself, top to bottom.

GetAllBaseTypesInclusiveAscending(IEntityType)

Returns all base types of the given IEntityType, including the type itself, bottom to top.

GetChangeTrackingStrategy(IEntityType)

Gets the change tracking strategy being used for this entity type. This strategy indicates how the context detects changes to properties for an instance of the entity type.

GetClosestCommonParent(IEntityType, IEntityType)
Obsolete.

Returns the closest entity type that is a parent of both given entity types. If one of the given entities is a parent of the other, that parent is returned. Returns null if the two entity types aren't in the same hierarchy.

GetConcreteDerivedTypesInclusive(IEntityType)

Returns all the derived types of the given IEntityType, including the type itself, which are not abstract.

GetDeclaredForeignKeys(IEntityType)

Gets all foreign keys declared on the given IEntityType.

This method does not return foreign keys declared on base types. It is useful when iterating over all entity types to avoid processing the same foreign key more than once. Use GetForeignKeys() to also return foreign keys declared on base types.

GetDeclaredIndexes(IEntityType)

Gets all indexes declared on the given IEntityType.

This method does not return indexes declared on base types. It is useful when iterating over all entity types to avoid processing the same index more than once. Use GetForeignKeys() to also return indexes declared on base types.

GetDeclaredKeys(IEntityType)

Gets all keys declared on the given IEntityType.

This method does not return keys declared on base types. It is useful when iterating over all entity types to avoid processing the same key more than once. Use GetKeys() to also return keys declared on base types.

GetDeclaredNavigations(IEntityType)

Gets all navigation properties declared on the given IEntityType.

This method does not return navigation properties declared on base types. It is useful when iterating over all entity types to avoid processing the same navigation property more than once. Use GetNavigations(IEntityType) to also return navigation properties declared on base types.

GetDeclaredProperties(IEntityType)

Gets all non-navigation properties declared on the given IEntityType.

This method does not return properties declared on base types. It is useful when iterating over all entity types to avoid processing the same property more than once. Use GetProperties() to also return properties declared on base types.

GetDeclaredReferencingForeignKeys(IEntityType)

Gets all foreign keys that target a given entity type (i.e. foreign keys where the given entity type is the principal).

GetDeclaredServiceProperties(IEntityType)

Gets all service properties declared on the given IEntityType.

This method does not return properties declared on base types. It is useful when iterating over all entity types to avoid processing the same property more than once. Use GetServiceProperties() to also return properties declared on base types.

GetDefiningQuery(IEntityType)
Obsolete.

Gets the LINQ query used as the default source for queries of this type.

GetDerivedForeignKeys(IEntityType)

Gets all foreign keys declared on the types derived from the given IEntityType.

This method does not return foreign keys declared on the given entity type itself. Use GetForeignKeys() to return foreign keys declared on this and base entity typed types.

GetDerivedTypes(IEntityType)

Gets all types in the model that derive from a given entity type.

GetDerivedTypesInclusive(IEntityType)

Returns all derived types of the given IEntityType, including the type itself.

GetDirectlyDerivedTypes(IEntityType)

Gets all types in the model that directly derive from a given entity type.

GetDiscriminatorProperty(IEntityType)
Obsolete.

Returns the IReadOnlyProperty that will be used for storing a discriminator value.

GetDiscriminatorValue(IEntityType)

Returns the discriminator value for this entity type.

GetIsDiscriminatorMappingComplete(IEntityType)

Returns the value indicating whether the discriminator mapping is complete for this entity type.

GetNavigations(IEntityType)
Obsolete.

Gets all navigation properties on the given entity type.

GetProperty(IEntityType, String)

Gets a property with the given name.

This API only finds scalar properties and does not find navigation properties. Use FindNavigation(IEntityType, String) to find a navigation property.

GetQueryFilter(IEntityType)

Gets the LINQ expression filter automatically applied to queries for this entity type.

GetReferencingForeignKeys(IEntityType)

Gets all foreign keys that target a given entity type (i.e. foreign keys where the given entity type is the principal).

GetRootType(IEntityType)

Gets the root base type for a given entity type.

GetSeedData(IEntityType, Boolean)

Gets the data stored in the model for the given entity type.

HasDefiningNavigation(IEntityType)
Obsolete.

Gets a value indicating whether this entity type has a defining navigation.

IsAbstract(ITypeBase)

Checks if this entity type represents an abstract type.

IsAssignableFrom(IEntityType, IEntityType)

Determines if this entity type derives from (or is the same as) a given entity type.

IsInOwnershipPath(IEntityType, IEntityType)

Gets a value indicating whether given entity type is in ownership path for this entity type.

IsOwned(IEntityType)

Gets a value indicating whether this entity type is owned by another entity type.

IsStrictlyDerivedFrom(IEntityType, IEntityType)

Determines if this entity type derives from (but is not the same as) a given entity type.

LeastDerivedType(IEntityType, IEntityType)

Gets the least derived type between the specified two.

RootType(IEntityType)
Obsolete.

Gets the root base type for a given entity type.

ShortName(ITypeBase)

Gets a short name for the given ITypeBase that can be used in other identifiers.

ToDebugString(IEntityType, MetadataDebugStringOptions, Int32)

Creates a human-readable representation of the given metadata.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

Applies to