Delen via


ModelExtensions Class

Definition

Caution

Use IReadOnlyModel

Extension methods for IReadOnlyModel.

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

Methods

FindEntityType(IModel, Type, String, IEntityType)

Gets the entity type for the given type, defining navigation name and the defining entity type. Returns null if no matching entity type is found.

FindEntityType(IModel, Type)
Obsolete.

Gets the entity that maps the given entity class. Returns null if no entity type with the given CLR type is found or the given CLR type is being used by shared type entity type or the entity type has a defining navigation.

FindRuntimeEntityType(IModel, Type)

Gets the entity that maps the given entity class, where the class may be a proxy derived from the actual entity type. Returns null if no entity type with the given CLR type is found or the given CLR type is being used by shared type entity type or the entity type has a defining navigation.

GetChangeTrackingStrategy(IModel)

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

GetEntityTypes(IModel, String)
Obsolete.

Gets the entity types matching the given name.

GetEntityTypes(IModel, Type)
Obsolete.

Gets the entity types matching the given type.

GetProductVersion(IModel)

Gets the EF Core assembly version used to build this model

GetPropertyAccessMode(IModel)

Gets the PropertyAccessMode being used for properties of entity types in this model.

Note that individual entity types can override this access mode, and individual properties of entity types can override the access mode set on the entity type. The value returned here will be used for any property for which no override has been specified.

HasEntityTypeWithDefiningNavigation(IModel, String)
Obsolete.

Gets a value indicating whether the model contains a corresponding entity type with a defining navigation.

HasEntityTypeWithDefiningNavigation(IModel, Type)
Obsolete.

Gets a value indicating whether the model contains a corresponding entity type with a defining navigation.

IsIndexerMethod(IModel, MethodInfo)

Gets a value indicating whether the given MethodInfo reprensent an indexer access.

IsShared(IModel, Type)

Gets whether the CLR type is used by shared type entities in the model.

ToDebugString(IModel, 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