ModelExtensions ModelExtensions Class

Extension methods for IModel.

Syntax

Declaration

public static class ModelExtensionsPublic Module ModelExtensions

Inheritance Hierarchy

  • System.Object
    System.Object
  • ModelExtensions
    ModelExtensions

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Methods summary

Gets the entity that maps the given entity class. Returns null if no entity type with the given name is found.

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.

Gets the PropertyAccessMode being used for properties of entity types in this model. Null indicates that the default property access mode is being used.

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.

Methods

  • FindEntityType(IModel, Type)
    FindEntityType(IModel, Type)

    Gets the entity that maps the given entity class. Returns null if no entity type with the given name is found.

    public static IEntityType FindEntityType(this IModel model, Type type)<ExtensionAttribute>
    Public Shared Function FindEntityType(model As IModel, type As Type) As IEntityType

    Parameters

    • model

      The model to find the entity type in.

    • type
      System.Type
      System.Type

      The type of the entity class to find the type for.

    Returns

  • GetChangeTrackingStrategy(IModel)
    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.

    public static ChangeTrackingStrategy GetChangeTrackingStrategy(this IModel model)<ExtensionAttribute>
    Public Shared Function GetChangeTrackingStrategy(model As IModel) As ChangeTrackingStrategy

    Parameters

    • model

      The model to get the default change tracking strategy for.

    Returns

  • GetPropertyAccessMode(IModel)
    GetPropertyAccessMode(IModel)

    Gets the PropertyAccessMode being used for properties of entity types in this model. Null indicates that the default property access mode is being used.

    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.

    public static PropertyAccessMode? GetPropertyAccessMode(this IModel model)<ExtensionAttribute>
    Public Shared Function GetPropertyAccessMode(model As IModel) As PropertyAccessMode?

    Parameters

    Returns

Details

Assembly

Microsoft.EntityFrameworkCore.dll