MutableEntityTypeExtensions.GetOrAddProperty 方法

定义

重载

GetOrAddProperty(IMutableEntityType, PropertyInfo)

获取具有给定名称的属性,或者创建一个新属性(如果尚未定义)。

GetOrAddProperty(IMutableEntityType, String, Type)

获取具有给定名称的属性,或者创建一个新属性(如果尚未定义)。

GetOrAddProperty(IMutableEntityType, String, Type, Boolean)

获取具有给定名称的属性,或者创建一个新属性(如果尚未定义)。

GetOrAddProperty(IMutableEntityType, PropertyInfo)

获取具有给定名称的属性,或者创建一个新属性(如果尚未定义)。

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

参数

entityType
IMutableEntityType

要获取或添加属性的实体类型。

propertyInfo
PropertyInfo

实体类中的相应属性。

返回

现有或新创建的属性。

注解

返回的属性可能没有指定的类型。

适用于

GetOrAddProperty(IMutableEntityType, String, Type)

获取具有给定名称的属性,或者创建一个新属性(如果尚未定义)。

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

参数

entityType
IMutableEntityType

要获取或添加属性的实体类型。

name
String

属性的名称。

propertyType
Type

属性将保留的值的类型。

返回

现有或新创建的属性。

注解

返回的属性可能没有指定的类型。

适用于

GetOrAddProperty(IMutableEntityType, String, Type, Boolean)

获取具有给定名称的属性,或者创建一个新属性(如果尚未定义)。

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

参数

entityType
IMutableEntityType

要获取或添加属性的实体类型。

name
String

属性的名称。

propertyType
Type

属性将保留的值的类型。

shadow
Boolean

属性是否处于阴影状态。

返回

现有或新创建的属性。

注解

返回的属性可能没有指定的类型和阴影。

适用于