ModelExtensions ModelExtensions Class

Definition

Extension methods for IModel.

public static class ModelExtensions
Public Module ModelExtensions
Inheritance
System.ObjectSystem.Object
ModelExtensionsModelExtensions

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

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
IModel IModel

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

The entity type, or null if none if found.

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
IModel IModel

The model to get the default change tracking strategy for.

Returns

The change tracking strategy.

GetHashCode() GetHashCode()

Inherited from System.Object

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
model
IModel IModel

The model to get the access mode for.

Returns
System.Nullable<PropertyAccessMode> System.Nullable(Of PropertyAccessMode)

The access mode being used, or null if the default access mode is being used.

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object