Share via


MutableModelExtensions Class

Definition

Caution

Use IMutableModel

Extension methods for IMutableModel.

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

Methods

AddIgnored(IMutableModel, Type)

Marks the given entity type as ignored, preventing conventions from adding a matching entity type to the model.

AddOwned(IMutableModel, Type)

Marks the given entity type as owned, indicating that when discovered matching entity types should be configured as owned.

AddShared(IMutableModel, Type)

Marks the given entity type as shared, indicating that when discovered matching entity types should be configured as shared type entity type.

FinalizeModel(IMutableModel)

Forces post-processing on the model such that it is ready for use by the runtime. This post processing happens automatically when using OnModelCreating(ModelBuilder); this method allows it to be run explicitly in cases where the automatic execution is not possible.

FindEntityType(IMutableModel, Type, String, IMutableEntityType)

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

FindEntityType(IMutableModel, Type)

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.

FindLeastDerivedEntityTypes(IMutableModel, Type, Func<IMutableEntityType,Boolean>)

Returns the entity types corresponding to the least derived types from the given.

GetEntityTypes(IMutableModel, String)
Obsolete.

Gets the entity types matching the given name.

GetEntityTypes(IMutableModel, Type)
Obsolete.

Gets the entity types matching the given type.

GetOrAddEntityType(IMutableModel, String)

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

GetOrAddEntityType(IMutableModel, Type)

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

IsIgnored(IMutableModel, Type)

Indicates whether the given entity type name is ignored.

IsOwned(IMutableModel, Type)

Returns a value indicating whether the entity types using the given type should be configured as owned types when discovered by conventions.

RemoveEntityType(IMutableModel, IMutableEntityType)

Removes an entity type from the model.

RemoveEntityType(IMutableModel, String, String, IMutableEntityType)

Removes an entity type with a defining navigation from the model.

RemoveEntityType(IMutableModel, String)

Removes an entity type without a defining navigation from the model.

RemoveEntityType(IMutableModel, Type, String, IMutableEntityType)

Removes an entity type with a defining navigation from the model.

RemoveEntityType(IMutableModel, Type)

Removes an entity type from the model.

RemoveIgnored(IMutableModel, Type)

Removes the ignored entity type.

RemoveOwned(IMutableModel, Type)

Removes the given owned type, indicating that when discovered matching entity types should not be configured as owned.

SetChangeTrackingStrategy(IMutableModel, ChangeTrackingStrategy)

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

SetChangeTrackingStrategy(IMutableModel, Nullable<ChangeTrackingStrategy>)

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

SetPropertyAccessMode(IMutableModel, Nullable<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.

SetPropertyAccessMode(IMutableModel, Nullable<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.

Applies to