다음을 통해 공유


IEntityType Interface

Definition

Represents an entity type in a model.

public interface IEntityType : Microsoft.EntityFrameworkCore.Infrastructure.IAnnotatable
public interface IEntityType : Microsoft.EntityFrameworkCore.Metadata.ITypeBase
public interface IEntityType : Microsoft.EntityFrameworkCore.Metadata.IReadOnlyEntityType, Microsoft.EntityFrameworkCore.Metadata.ITypeBase
type IEntityType = interface
    interface IAnnotatable
type IEntityType = interface
    interface ITypeBase
    interface IAnnotatable
type IEntityType = interface
    interface IReadOnlyEntityType
    interface IReadOnlyTypeBase
    interface IReadOnlyAnnotatable
    interface ITypeBase
    interface IAnnotatable
Public Interface IEntityType
Implements IAnnotatable
Public Interface IEntityType
Implements ITypeBase
Public Interface IEntityType
Implements IReadOnlyEntityType, ITypeBase
Derived
Implements

Remarks

See Modeling entity types and relationships for more information and examples.

Properties

BaseType

Gets the base type of this entity type. Returns null if this is not a derived type in an inheritance hierarchy.

ClrType

Gets the CLR class that is used to represent instances of this type. Returns null if the type does not have a corresponding CLR class (known as a shadow type).

Shadow types are not currently supported in a model that is used at runtime with a DbContext. Therefore, shadow types will only exist in migration model snapshots, etc.

ConstructorBinding

Gets the InstantiationBinding for the preferred constructor.

ContainingEntityType

Gets this entity type or the one on which the complex property chain is declared.

(Inherited from IReadOnlyTypeBase)
DefiningEntityType

Gets the defining entity type.

DefiningNavigationName

Gets the name of the defining navigation.

DefiningQuery

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

HasSharedClrType

Gets a value indicating whether this structural type is mapped to a Type that other structural types are also mapped to.

(Inherited from IReadOnlyTypeBase)
IsPropertyBag

Gets a value indicating whether this structural type has an indexer which is able to contain arbitrary properties and a method that can be used to determine whether a given indexer property contains a value.

(Inherited from IReadOnlyTypeBase)
IsQueryType

Gets whether this entity type is a query type.

Item[String]

Gets the value of the annotation with the given name, returning null if it does not exist.

(Inherited from IReadOnlyAnnotatable)
Model

Gets the model that this type belongs to.

Name

Gets the name of this type.

QueryFilter

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

ServiceOnlyConstructorBinding

Gets the InstantiationBinding for the preferred constructor when creating instances with only service properties initialized.

Methods

AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from IAnnotatable)
AnnotationsToDebugString(Int32)

Gets the debug string for all annotations declared on the object.

(Inherited from IReadOnlyAnnotatable)
DisplayName()

Gets the friendly display name for this structural type.

(Inherited from IReadOnlyTypeBase)
DisplayName(Boolean)

Gets the friendly display name for the given IReadOnlyTypeBase.

(Inherited from IReadOnlyTypeBase)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from IReadOnlyAnnotatable)
FindClosestCommonParent(IEntityType)

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.

FindClosestCommonParent(IReadOnlyEntityType)

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.

(Inherited from IReadOnlyEntityType)
FindComplexProperty(MemberInfo)

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

(Inherited from IReadOnlyTypeBase)
FindComplexProperty(String)

Gets the complex property with the given name. Returns null if no property with the given name is defined.

(Inherited from IReadOnlyTypeBase)
FindDeclaredComplexProperty(String)

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

(Inherited from IReadOnlyTypeBase)
FindDeclaredForeignKeys(IReadOnlyList<IReadOnlyProperty>)

Gets the foreign keys declared on the given IEntityType using the given properties.

FindDeclaredNavigation(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(String)

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

FindDeclaredSkipNavigation(String)

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

FindDeclaredTrigger(String)

Finds a trigger with the given name.

FindDiscriminatorProperty()

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

FindForeignKey(IReadOnlyList<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.

FindForeignKey(IReadOnlyList<IReadOnlyProperty>, IReadOnlyKey, IReadOnlyEntityType)

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.

FindForeignKey(IReadOnlyProperty, IReadOnlyKey, IReadOnlyEntityType)

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(IReadOnlyList<IReadOnlyProperty>)

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

FindForeignKeys(IReadOnlyProperty)

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.

FindIndex(IReadOnlyList<IProperty>)

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

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

FindIndex(IReadOnlyList<IReadOnlyProperty>)

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

FindIndex(IReadOnlyProperty)

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

FindIndex(String)

Gets the index with the given name. Returns null if no such index exists.

FindIndexerPropertyInfo()

Returns the PropertyInfo for the indexer on the associated CLR type if one exists.

(Inherited from IReadOnlyTypeBase)
FindKey(IReadOnlyList<IProperty>)

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

FindKey(IReadOnlyList<IReadOnlyProperty>)

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

FindKey(IReadOnlyProperty)

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

FindMember(String)

Gets the member with the given name. Returns null if no member with the given name is defined.

(Inherited from IReadOnlyTypeBase)
FindMembersInHierarchy(String)

Gets the members with the given name on this type, base types or derived types.

(Inherited from IReadOnlyTypeBase)
FindNavigation(MemberInfo)

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

FindNavigation(String)

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

FindOwnership()

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

FindPrimaryKey()

Gets primary key for this entity type. Returns null if no primary key is defined.

FindProperties(IReadOnlyList<String>)

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

FindProperty(MemberInfo)

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

FindProperty(String)

Gets the property with a given name. Returns null if no property with the given name is defined.

FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

(Inherited from IAnnotatable)
FindRuntimeAnnotationValue(String)

Gets the value of the runtime annotation with the given name, returning null if it does not exist.

(Inherited from IAnnotatable)
FindServiceProperty(String)

Gets the service property with a given name. Returns null if no property with the given name is defined.

FindSkipNavigation(MemberInfo)

Gets a skip navigation property on this entity type. Returns null if no navigation property is found.

FindSkipNavigation(String)

Gets a skip navigation property on this entity type. Returns null if no skip navigation property is found.

GetAllBaseTypes()

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

GetAllBaseTypesAscending()

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

GetAllBaseTypesInclusive()

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

GetAllBaseTypesInclusiveAscending()

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

GetAnnotation(String)

Gets the annotation with the given name, throwing if it does not exist.

(Inherited from IReadOnlyAnnotatable)
GetAnnotations()

Gets all annotations on the current object.

(Inherited from IReadOnlyAnnotatable)
GetChangeTrackingStrategy()

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

(Inherited from IReadOnlyTypeBase)
GetComplexProperties()

Gets the complex properties defined on this type and base types.

(Inherited from IReadOnlyTypeBase)
GetConcreteDerivedTypesInclusive()

Returns all the derived types of this entity type, including the type itself, which are not abstract.

GetDeclaredComplexProperties()

Gets the complex properties declared on this type.

(Inherited from IReadOnlyTypeBase)
GetDeclaredForeignKeys()

Gets all foreign keys declared on the given IEntityType.

GetDeclaredIndexes()

Gets all indexes declared on the given IEntityType.

GetDeclaredKeys()

Gets all keys declared on the given IReadOnlyEntityType.

GetDeclaredMembers()

Gets the members declared on this type.

(Inherited from IReadOnlyTypeBase)
GetDeclaredNavigations()

Gets all navigation properties declared on the given IEntityType.

GetDeclaredProperties()

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

GetDeclaredReferencingForeignKeys()

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

GetDeclaredServiceProperties()

Gets all service properties declared on the given IEntityType.

GetDeclaredSkipNavigations()

Gets all skip navigation properties declared on this entity type.

GetDeclaredTriggers()

Returns the declared triggers on the entity type.

GetDefaultDiscriminatorValue()

Returns the default discriminator value that would be used for this entity type.

(Inherited from IReadOnlyEntityType)
GetDerivedComplexProperties()

Gets the complex properties declared on the types derived from this type.

(Inherited from IReadOnlyTypeBase)
GetDerivedForeignKeys()

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

GetDerivedIndexes()

Gets all indexes declared on the types derived from the given IEntityType.

GetDerivedNavigations()

Gets all navigation properties declared on the types derived from this entity type.

GetDerivedProperties()

Gets all non-navigation properties declared on the types derived from this entity type.

GetDerivedServiceProperties()

Gets all service properties declared on the types derived from this entity type.

GetDerivedSkipNavigations()

Gets all skip navigation properties declared on the types derived from this entity type.

GetDerivedTypes()

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

GetDerivedTypesInclusive()

Returns all derived types of this entity type, including the type itself.

GetDirectlyDerivedTypes()

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

GetDiscriminatorPropertyName()

Returns the name of the property that will be used for storing a discriminator value.

(Inherited from IReadOnlyEntityType)
GetDiscriminatorValue()

Returns the discriminator value for this entity type.

(Inherited from IReadOnlyEntityType)
GetFlattenedComplexProperties()

Returns all properties that implement IComplexProperty, including those on complex types.

(Inherited from ITypeBase)
GetFlattenedDeclaredProperties()

Returns all declared properties that implement IProperty, including those on complex types.

(Inherited from ITypeBase)
GetFlattenedProperties()

Returns all properties that implement IProperty, including those on complex types.

(Inherited from ITypeBase)
GetFlattenedPropertiesInHierarchy()

Gets all properties declared on the base types and types derived from this entity type, including those on complex types.

(Inherited from ITypeBase)
GetForeignKeyProperties()

Returns the properties contained in foreign keys.

GetForeignKeys()

Gets the foreign keys defined on this entity type.

GetIndexes()

Gets the indexes defined on this entity type.

GetIsDiscriminatorMappingComplete()

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

(Inherited from IReadOnlyEntityType)
GetKeys()

Gets the primary and alternate keys for this entity type.

GetMembers()

Gets the members defined on this type and base types.

(Inherited from IReadOnlyTypeBase)
GetNavigationAccessMode()

Gets the PropertyAccessMode being used for navigations of this type.

(Inherited from IReadOnlyTypeBase)
GetNavigations()

Gets all navigation properties on the given entity type.

GetNavigationsInHierarchy()

Gets all navigation properties declared on the base types and types derived from this entity type.

GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

Gets the value of the runtime annotation with the given name, adding it if one does not exist.

(Inherited from IAnnotatable)
GetOrCreateEmptyMaterializer(IEntityMaterializerSource)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from IReadOnlyEntityType)
GetOrCreateMaterializer(IEntityMaterializerSource)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from IReadOnlyEntityType)
GetProperties()

Gets the properties defined on this entity type.

GetPropertiesInHierarchy()

Gets all properties declared on the base types and types derived from this entity type.

(Inherited from ITypeBase)
GetProperty(String)

Gets a property with the given name.

GetPropertyAccessMode()

Gets the PropertyAccessMode being used for properties and navigations of this type.

(Inherited from IReadOnlyTypeBase)
GetQueryFilter()

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

(Inherited from IReadOnlyEntityType)
GetReferencingForeignKeys()

Gets all foreign keys that target a given entity type (i.e. foreign keys where the given entity type or a type it's derived from is the principal).

GetRootType()

Gets the root base type for a given entity type.

GetRuntimeAnnotations()

Gets all the runtime annotations on the current object.

(Inherited from IAnnotatable)
GetSeedData(Boolean)

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

(Inherited from IReadOnlyEntityType)
GetServiceProperties()

Gets all the IServiceProperty defined on this entity type.

GetSkipNavigations()

Gets the skip navigation properties on this entity type.

GetSnapshottableMembers()

Returns all members that may need a snapshot value when change tracking.

(Inherited from ITypeBase)
GetValueGeneratingProperties()

Returns the properties that need a value to be generated when the entity entry transitions to the Added state.

HasDefiningNavigation()
Obsolete.

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

(Inherited from IReadOnlyEntityType)
HasServiceProperties()

Checks whether or not this entity type has any IServiceProperty defined.

(Inherited from IReadOnlyEntityType)
IsAbstract()

Gets a value indicating whether this structural type represents an abstract type.

(Inherited from IReadOnlyTypeBase)
IsAssignableFrom(IReadOnlyEntityType)

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

(Inherited from IReadOnlyEntityType)
IsAssignableFrom(IReadOnlyTypeBase)

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

(Inherited from IReadOnlyTypeBase)
IsInOwnershipPath(IReadOnlyEntityType)

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

(Inherited from IReadOnlyEntityType)
IsOwned()

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

(Inherited from IReadOnlyEntityType)
IsStrictlyDerivedFrom(IReadOnlyEntityType)

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

(Inherited from IReadOnlyEntityType)
IsStrictlyDerivedFrom(IReadOnlyTypeBase)

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

(Inherited from IReadOnlyTypeBase)
LeastDerivedType(IEntityType)

Gets the least derived type between the specified two.

LeastDerivedType(IReadOnlyEntityType)

Gets the least derived type between the specified two.

(Inherited from IReadOnlyEntityType)
RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from IAnnotatable)
SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from IAnnotatable)
ShortName()

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

(Inherited from IReadOnlyTypeBase)
ToDebugString(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.

(Inherited from IReadOnlyEntityType)

Explicit Interface Implementations

IReadOnlyTypeBase.IsAssignableFrom(IReadOnlyTypeBase)

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

(Inherited from IReadOnlyEntityType)
ITypeBase.GetFlattenedPropertiesInHierarchy()

Gets all properties declared on the base types and types derived from this entity type, including those on complex types.

ITypeBase.GetPropertiesInHierarchy()

Gets all properties declared on the base types and types derived from this entity type.

Extension Methods

GetAnalyticalStoreTimeToLive(IReadOnlyEntityType)

Returns the time to live for analytical store in seconds at container scope.

GetContainer(IEntityType)

Returns the name of the container to which the entity type is mapped.

GetContainer(IReadOnlyEntityType)

Returns the name of the container to which the entity type is mapped.

GetContainingPropertyName(IEntityType)

Returns the name of the parent property to which the entity type is mapped.

GetContainingPropertyName(IReadOnlyEntityType)

Returns the name of the parent property to which the entity type is mapped.

GetDefaultTimeToLive(IReadOnlyEntityType)

Returns the default time to live in seconds at container scope.

GetDiscriminatorInKey(IReadOnlyEntityType)

Returns a value indicating whether the entity type discriminator should be included in the JSON "id" value. Prior to EF Core 9, it was always included. Starting with EF Core 9, it is not included by default.

GetETagProperty(IEntityType)

Gets the property on this entity that is mapped to Cosmos ETag, if it exists.

GetETagProperty(IReadOnlyEntityType)

Gets the property on this entity that is mapped to Cosmos ETag, if it exists.

GetETagPropertyName(IEntityType)

Returns the name of the property that is used to store the etag.

GetETagPropertyName(IReadOnlyEntityType)

Returns the name of the property that is used to store the ETag.

GetHasShadowId(IReadOnlyEntityType)

Returns a value indicating whether model building will always create a "__id" shadow property mapped to the JSON "id". This was the default behavior before EF Core 9.0.

GetPartitionKeyProperties(IEntityType)

Returns the the properties that are used to store the hierarchical partition key.

GetPartitionKeyProperties(IReadOnlyEntityType)

Returns the the properties that are used to store the hierarchical partition key.

GetPartitionKeyProperty(IEntityType)
Obsolete.

Returns the property that is used to store the partition key.

GetPartitionKeyProperty(IReadOnlyEntityType)
Obsolete.

Returns the property that is used to store the partition key.

GetPartitionKeyPropertyName(IEntityType)

Returns the name of the property that is used to store the partition key.

GetPartitionKeyPropertyName(IReadOnlyEntityType)
Obsolete.

Returns the name of the property that is used to store the partition key.

GetPartitionKeyPropertyNames(IReadOnlyEntityType)

Returns the names of the properties that are used to store the hierarchical partition key, if any.

GetThroughput(IReadOnlyEntityType)

Returns the provisioned throughput at container scope.

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.

AnnotationsToDebugString(IAnnotatable, Int32)

Gets the debug string for all annotations declared on the object.

GetAnnotation(IAnnotatable, String)

Gets the annotation with the given name, throwing if it does not exist.

GetInMemoryQuery(IEntityType)

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

GetInMemoryQuery(IReadOnlyEntityType)

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

FindCheckConstraint(IEntityType, String)

Finds an ICheckConstraint with the given name.

FindCheckConstraint(IReadOnlyEntityType, String)

Finds an IReadOnlyCheckConstraint with the given name.

FindMappingFragment(IEntityType, StoreObjectIdentifier)

Returns the entity type mapping for a particular table-like store object.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

FindMappingFragment(IReadOnlyEntityType, StoreObjectIdentifier)

Returns the entity type mapping for a particular table-like store object.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

FindRowInternalForeignKeys(IEntityType, StoreObjectIdentifier)

Gets the foreign keys for the given entity type that point to other entity types sharing the same table-like store object.

FindRowInternalForeignKeys(IEntityType, StoreObjectIdentifier)

Gets the foreign keys for the given entity type that point to other entity types sharing the same table-like store object.

FindRowInternalForeignKeys(IReadOnlyEntityType, StoreObjectIdentifier)

Gets the foreign keys for the given entity type that point to other entity types sharing the same table-like store object.

GetCheckConstraints(IEntityType)

Returns all check constraints contained in the entity type.

GetCheckConstraints(IReadOnlyEntityType)

Returns all check constraints contained in the entity type.

GetComment(IEntityType)

Returns the comment for the table this entity is mapped to.

GetComment(IReadOnlyEntityType)

Returns the comment for the table this entity is mapped to.

GetContainerColumnName(IReadOnlyEntityType)

Gets the container column name to which the entity type is mapped.

GetContainerColumnType(IReadOnlyEntityType)

Gets the column type to use for the container column to which the entity type is mapped.

GetContainerColumnTypeMapping(IReadOnlyEntityType)
Obsolete.

Gets the container column type mapping to which the entity type is mapped.

GetDeclaredCheckConstraints(IEntityType)

Returns all check constraints declared on the entity type.

GetDeclaredCheckConstraints(IReadOnlyEntityType)

Returns all check constraints declared on the entity type.

GetDefaultMappings(IEntityType)

Returns the default mappings that the entity type would use.

GetDefaultSchema(IEntityType)

Returns the default database schema that would be used for this entity type.

GetDefaultSchema(IReadOnlyEntityType)

Returns the default database schema that would be used for this entity type.

GetDefaultSqlQueryName(IEntityType)

Gets the default SQL query name that would be used for this entity type when mapped using RelationalEntityTypeBuilderExtensions.ToSqlQuery.

GetDefaultSqlQueryName(IReadOnlyEntityType)

Gets the default SQL query name that would be used for this entity type when mapped using RelationalEntityTypeBuilderExtensions.ToSqlQuery.

GetDefaultTableName(IEntityType, Boolean)

Returns the default table name that would be used for this entity type.

GetDefaultTableName(IEntityType)

Returns the default table name that would be used for this entity type.

GetDefaultTableName(IReadOnlyEntityType, Boolean)

Returns the default table name that would be used for this entity type.

GetDefaultViewName(IEntityType)

Returns the default view name that would be used for this entity type.

GetDefaultViewName(IReadOnlyEntityType)

Returns the default view name that would be used for this entity type.

GetDefaultViewSchema(IEntityType)

Returns the default database schema that would be used for this entity view.

GetDefaultViewSchema(IReadOnlyEntityType)

Returns the default database schema that would be used for this entity view.

GetDeleteStoredProcedure(IEntityType)

Returns the stored procedure to which the entity type is mapped for deletes or null if not mapped to a stored procedure.

GetDeleteStoredProcedure(IReadOnlyEntityType)

Returns the stored procedure to which the entity type is mapped for deletes or null if not mapped to a stored procedure.

GetDeleteStoredProcedureMappings(IEntityType)

Returns the delete stored procedures to which the entity type is mapped.

GetFunctionMappings(IEntityType)

Returns the functions to which the entity type is mapped.

GetFunctionName(IEntityType)

Returns the name of the function to which the entity type is mapped or null if not mapped to a function.

GetFunctionName(IReadOnlyEntityType)

Returns the name of the function to which the entity type is mapped or null if not mapped to a function.

GetInsertStoredProcedure(IEntityType)

Returns the stored procedure to which the entity type is mapped for inserts or null if not mapped to a stored procedure.

GetInsertStoredProcedure(IReadOnlyEntityType)

Returns the stored procedure to which the entity type is mapped for inserts or null if not mapped to a stored procedure.

GetInsertStoredProcedureMappings(IEntityType)

Returns the insert stored procedures to which the entity type is mapped.

GetJsonPropertyName(IReadOnlyEntityType)

Gets the value of JSON property name used for the given entity mapped to a JSON column.

GetMappingFragments(IEntityType, StoreObjectType)

Returns all configured entity type mapping fragments of the given type.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingFragments(IEntityType)

Returns all configured entity type mapping fragments.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingFragments(IReadOnlyEntityType, StoreObjectType)

Returns all configured entity type mapping fragments of the given type.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingFragments(IReadOnlyEntityType)

Returns all configured entity type mapping fragments.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingStrategy(IReadOnlyEntityType)

Gets the mapping strategy for the derived types.

GetSchema(IEntityType)

Returns the database schema that contains the mapped table.

GetSchema(IReadOnlyEntityType)

Returns the database schema that contains the mapped table.

GetSchemaQualifiedTableName(IEntityType)

Returns the name of the table to which the entity type is mapped prepended by the schema or null if not mapped to a table.

GetSchemaQualifiedTableName(IReadOnlyEntityType)

Returns the name of the table to which the entity type is mapped prepended by the schema or null if not mapped to a table.

GetSchemaQualifiedViewName(IEntityType)

Returns the name of the view to which the entity type is mapped prepended by the schema or null if not mapped to a view.

GetSchemaQualifiedViewName(IReadOnlyEntityType)

Returns the name of the view to which the entity type is mapped prepended by the schema or null if not mapped to a view.

GetSqlQuery(IEntityType)

Returns the SQL string used to provide data for the entity type or null if not mapped to a SQL string.

GetSqlQuery(IReadOnlyEntityType)

Returns the SQL string used to provide data for the entity type or null if not mapped to a SQL string.

GetSqlQueryMappings(IEntityType)

Returns the SQL string mappings.

GetTableMappings(IEntityType)

Returns the tables to which the entity type is mapped.

GetTableName(IEntityType)

Returns the name of the table to which the entity type is mapped or null if not mapped to a table.

GetTableName(IReadOnlyEntityType)

Returns the name of the table to which the entity type is mapped or null if not mapped to a table.

GetUpdateStoredProcedure(IEntityType)

Returns the stored procedure to which the entity type is mapped for updates or null if not mapped to a stored procedure.

GetUpdateStoredProcedure(IReadOnlyEntityType)

Returns the stored procedure to which the entity type is mapped for updates or null if not mapped to a stored procedure.

GetUpdateStoredProcedureMappings(IEntityType)

Returns the update stored procedures to which the entity type is mapped.

GetViewMappings(IEntityType)

Returns the views to which the entity type is mapped.

GetViewName(IEntityType)

Returns the name of the view to which the entity type is mapped or null if not mapped to a view.

GetViewName(IReadOnlyEntityType)

Returns the name of the view to which the entity type is mapped or null if not mapped to a view.

GetViewSchema(IEntityType)

Returns the database schema that contains the mapped view.

GetViewSchema(IReadOnlyEntityType)

Returns the database schema that contains the mapped view.

IsIgnoredByMigrations(IEntityType)

Gets a value indicating whether the entity type is ignored by Migrations.

IsMappedToJson(IReadOnlyEntityType)

Gets a value indicating whether the specified entity is mapped to a JSON column.

IsTableExcludedFromMigrations(IEntityType)

Gets a value indicating whether the associated table is ignored by Migrations.

IsTableExcludedFromMigrations(IReadOnlyEntityType, StoreObjectIdentifier)

Gets a value indicating whether the specified table is ignored by Migrations.

IsTableExcludedFromMigrations(IReadOnlyEntityType)

Gets a value indicating whether the associated table is ignored by Migrations.

Relational(IEntityType)

Gets the relational database specific metadata for an entity.

FindMappingFragment(IReadOnlyTypeBase, StoreObjectIdentifier)

Returns the type mapping for a particular table-like store object.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

FindMappingFragment(ITypeBase, StoreObjectIdentifier)

Returns the type mapping for a particular table-like store object.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetContainerColumnName(IReadOnlyTypeBase)

Gets the container column name to which the type is mapped.

GetContainerColumnType(IReadOnlyTypeBase)

Gets the column type to use for the container column to which the type is mapped.

GetDefaultMappings(ITypeBase)

Returns the default mappings that the type would use.

GetDeleteStoredProcedure(IReadOnlyTypeBase)

Returns the stored procedure to which the type is mapped for deletes or null if not mapped to a stored procedure.

GetDeleteStoredProcedure(ITypeBase)

Returns the stored procedure to which the type is mapped for deletes or null if not mapped to a stored procedure.

GetDeleteStoredProcedureMappings(ITypeBase)

Returns the delete stored procedures to which the type is mapped.

GetFunctionMappings(ITypeBase)

Returns the functions to which the type is mapped.

GetFunctionName(IReadOnlyTypeBase)

Returns the name of the function to which the type is mapped or null if not mapped to a function.

GetInsertStoredProcedure(IReadOnlyTypeBase)

Returns the stored procedure to which the type is mapped for inserts or null if not mapped to a stored procedure.

GetInsertStoredProcedure(ITypeBase)

Returns the stored procedure to which the type is mapped for inserts or null if not mapped to a stored procedure.

GetInsertStoredProcedureMappings(ITypeBase)

Returns the insert stored procedures to which the type is mapped.

GetJsonPropertyName(IReadOnlyTypeBase)

Gets the value of JSON property name used for the given entity mapped to a JSON column.

GetMappingFragments(IReadOnlyTypeBase, StoreObjectType)

Returns all configured type mapping fragments of the given type.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingFragments(IReadOnlyTypeBase)

Returns all configured type mapping fragments.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingFragments(ITypeBase, StoreObjectType)

Returns all configured type mapping fragments of the given type.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingFragments(ITypeBase)

Returns all configured type mapping fragments.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

GetMappingStrategy(IReadOnlyTypeBase)

Gets the mapping strategy for the derived types.

GetSchema(IReadOnlyTypeBase)

Returns the database schema that contains the mapped table.

GetSqlQuery(IReadOnlyTypeBase)

Returns the SQL string used to provide data for the type or null if not mapped to a SQL string.

GetSqlQueryMappings(ITypeBase)

Returns the SQL string mappings.

GetTableMappings(ITypeBase)

Returns the tables to which the type is mapped.

GetTableName(IReadOnlyTypeBase)

Returns the name of the table to which the type is mapped or null if not mapped to a table.

GetUpdateStoredProcedure(IReadOnlyTypeBase)

Returns the stored procedure to which the type is mapped for updates or null if not mapped to a stored procedure.

GetUpdateStoredProcedure(ITypeBase)

Returns the stored procedure to which the type is mapped for updates or null if not mapped to a stored procedure.

GetUpdateStoredProcedureMappings(ITypeBase)

Returns the update stored procedures to which the type is mapped.

GetViewMappings(ITypeBase)

Returns the views to which the type is mapped.

GetViewName(IReadOnlyTypeBase)

Returns the name of the view to which the type is mapped or null if not mapped to a view.

GetViewSchema(IReadOnlyTypeBase)

Returns the database schema that contains the mapped view.

IsMappedToJson(IReadOnlyTypeBase)

Gets a value indicating whether the specified entity is mapped to a JSON column.

GetDataAnnotations(IEntityType, IAnnotationCodeGenerator)

Gets the data annotations to configure an entity type.

GetDbSetName(IReadOnlyEntityType)

Gets the name that should be used for the DbSet<TEntity> property on the DbContext class for this entity type.

GetFluentApiCalls(IEntityType, IAnnotationCodeGenerator)

Gets the fluent API calls to configure an entity type.

IsSimpleManyToManyJoinEntityType(IEntityType)

Check whether an entity type could be considered a many-to-many join entity type.

IsSqlReturningClauseUsed(IReadOnlyEntityType, StoreObjectIdentifier)

Returns a value indicating whether to use the SQL RETURNING clause when saving changes to the table. The RETURNING clause is incompatible with certain Sqlite features, such as virtual tables or tables with AFTER triggers.

IsSqlReturningClauseUsed(IReadOnlyEntityType)

Returns a value indicating whether to use the SQL RETURNING clause when saving changes to the table. The RETURNING clause is incompatible with certain Sqlite features, such as virtual tables or tables with AFTER triggers.

Sqlite(IEntityType)

Gets the SQLite specific metadata for an entity.

GetHistoryTableName(IReadOnlyEntityType)

Returns a value representing the name of the history table associated with the entity mapped to a temporal table.

GetHistoryTableSchema(IReadOnlyEntityType)

Returns a value representing the schema of the history table associated with the entity mapped to a temporal table.

GetPeriodEndPropertyName(IReadOnlyEntityType)

Returns a value representing the name of the period end property of the entity mapped to a temporal table.

GetPeriodStartPropertyName(IReadOnlyEntityType)

Returns a value representing the name of the period start property of the entity mapped to a temporal table.

IsMemoryOptimized(IEntityType)

Returns a value indicating whether the entity type is mapped to a memory-optimized table.

IsMemoryOptimized(IReadOnlyEntityType)

Returns a value indicating whether the entity type is mapped to a memory-optimized table.

IsSqlOutputClauseUsed(IReadOnlyEntityType, StoreObjectIdentifier)

Returns a value indicating whether to use the SQL OUTPUT clause when saving changes to the specified table. The OUTPUT clause is incompatible with certain SQL Server features, such as tables with triggers.

IsSqlOutputClauseUsed(IReadOnlyEntityType)

Returns a value indicating whether to use the SQL OUTPUT clause when saving changes to the table. The OUTPUT clause is incompatible with certain SQL Server features, such as tables with triggers.

IsTemporal(IReadOnlyEntityType)

Returns a value indicating whether the entity type is mapped to a temporal table.

SqlServer(IEntityType)

Gets the SQL Server specific metadata for an entity.

GetNavigationAccessMode(ITypeBase)

Gets the PropertyAccessMode being used for navigations of this type.

Note that individual navigations can override this access mode. The value returned here will be used for any navigation for which no override has been specified.

GetPropertyAccessMode(ITypeBase)

Gets the PropertyAccessMode being used for properties and navigations of this type.

Note that individual properties and navigations can override this access mode. The value returned here will be used for any property or navigation for which no override has been specified.

Applies to