MutableModelExtensions MutableModelExtensions Class

Extension methods for IMutableModel.

Syntax

Declaration

public static class MutableModelExtensionsPublic Module MutableModelExtensions

Inheritance Hierarchy

  • System.Object
    System.Object
  • MutableModelExtensions
    MutableModelExtensions

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 entity type with the given name or adds a new entity type if none is found.

Gets the entity type with the given .NET type or adds a new entity type if none is found.

Removes an entity type from the model.

Sets the PropertyAccessMode to use for properties of all 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 set here will be used for any property for which no override has been specified.

Methods

  • FindEntityType(IMutableModel, Type)
    FindEntityType(IMutableModel, Type)

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

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

    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

  • GetOrAddEntityType(IMutableModel, String)
    GetOrAddEntityType(IMutableModel, String)

    Gets the entity type with the given name or adds a new entity type if none is found.

    public static IMutableEntityType GetOrAddEntityType(this IMutableModel model, string name)<ExtensionAttribute>
    Public Shared Function GetOrAddEntityType(model As IMutableModel, name As String) As IMutableEntityType

    Parameters

    • model

      The model to find or add the entity type to.

    • name
      System.String
      System.String

      The name of the entity type.

    Returns

  • GetOrAddEntityType(IMutableModel, Type)
    GetOrAddEntityType(IMutableModel, Type)

    Gets the entity type with the given .NET type or adds a new entity type if none is found.

    public static IMutableEntityType GetOrAddEntityType(this IMutableModel model, Type type)<ExtensionAttribute>
    Public Shared Function GetOrAddEntityType(model As IMutableModel, type As Type) As IMutableEntityType

    Parameters

    • model

      The model to find or add the entity type to.

    • type
      System.Type
      System.Type

      The .NET type of the entity type.

    Returns

  • RemoveEntityType(IMutableModel, Type)
    RemoveEntityType(IMutableModel, Type)

    Removes an entity type from the model.

    public static IMutableEntityType RemoveEntityType(this IMutableModel model, Type type)<ExtensionAttribute>
    Public Shared Function RemoveEntityType(model As IMutableModel, type As Type) As IMutableEntityType

    Parameters

    • model

      The model to remove the entity type from.

    • type
      System.Type
      System.Type

      The entity type to be removed.

    Returns

  • SetPropertyAccessMode(IMutableModel, Nullable<PropertyAccessMode>)
    SetPropertyAccessMode(IMutableModel, Nullable(Of PropertyAccessMode))

    Sets the PropertyAccessMode to use for properties of all 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 set here will be used for any property for which no override has been specified.

    public static void SetPropertyAccessMode(this IMutableModel model, PropertyAccessMode? propertyAccessMode)<ExtensionAttribute>
    Public Shared Sub SetPropertyAccessMode(model As IMutableModel, propertyAccessMode As PropertyAccessMode?)

    Parameters

Details

Assembly

Microsoft.EntityFrameworkCore.dll