MutableEntityTypeExtensions.GetOrAddProperty Method

Definition

Overloads

GetOrAddProperty(IMutableEntityType, PropertyInfo)

Gets the property with the given name, or creates a new one if one is not already defined.

GetOrAddProperty(IMutableEntityType, String, Type)

Gets the property with the given name, or creates a new one if one is not already defined.

GetOrAddProperty(IMutableEntityType, String, Type, Boolean)

Gets the property with the given name, or creates a new one if one is not already defined.

GetOrAddProperty(IMutableEntityType, PropertyInfo)

Gets the property with the given name, or creates a new one if one is not already defined.

public static Microsoft.EntityFrameworkCore.Metadata.IMutableProperty GetOrAddProperty (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, System.Reflection.PropertyInfo propertyInfo);
static member GetOrAddProperty : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * System.Reflection.PropertyInfo -> Microsoft.EntityFrameworkCore.Metadata.IMutableProperty
<Extension()>
Public Function GetOrAddProperty (entityType As IMutableEntityType, propertyInfo As PropertyInfo) As IMutableProperty

Parameters

entityType
IMutableEntityType

The entity type to get or add the property to.

propertyInfo
PropertyInfo

The corresponding property in the entity class.

Returns

The existing or newly created property.

Remarks

The returned property might not have the specified type.

Applies to

GetOrAddProperty(IMutableEntityType, String, Type)

Gets the property with the given name, or creates a new one if one is not already defined.

public static Microsoft.EntityFrameworkCore.Metadata.IMutableProperty GetOrAddProperty (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, string name, Type propertyType);
static member GetOrAddProperty : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * string * Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableProperty
<Extension()>
Public Function GetOrAddProperty (entityType As IMutableEntityType, name As String, propertyType As Type) As IMutableProperty

Parameters

entityType
IMutableEntityType

The entity type to get or add the property to.

name
String

The name of the property.

propertyType
Type

The type of value the property will hold.

Returns

The existing or newly created property.

Remarks

The returned property might not have the specified type.

Applies to

GetOrAddProperty(IMutableEntityType, String, Type, Boolean)

Gets the property with the given name, or creates a new one if one is not already defined.

public static Microsoft.EntityFrameworkCore.Metadata.IMutableProperty GetOrAddProperty (this Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType entityType, string name, Type propertyType, bool shadow);
static member GetOrAddProperty : Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType * string * Type * bool -> Microsoft.EntityFrameworkCore.Metadata.IMutableProperty
<Extension()>
Public Function GetOrAddProperty (entityType As IMutableEntityType, name As String, propertyType As Type, shadow As Boolean) As IMutableProperty

Parameters

entityType
IMutableEntityType

The entity type to get or add the property to.

name
String

The name of the property.

propertyType
Type

The type of value the property will hold.

shadow
Boolean

Whether the property is in shadow-state.

Returns

The existing or newly created property.

Remarks

The returned property might not have the specified type and shadowness.

Applies to