RuntimeEntityType.AddServiceProperty 方法

定义

重载

AddServiceProperty(String, PropertyInfo, FieldInfo, PropertyAccessMode)

向此实体类型添加服务属性。

AddServiceProperty(String, PropertyInfo, FieldInfo, Type, PropertyAccessMode)

向此实体类型添加服务属性。

AddServiceProperty(String, PropertyInfo, FieldInfo, PropertyAccessMode)

向此实体类型添加服务属性。

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty AddServiceProperty (string name, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField);
abstract member AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
override this.AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
Public Overridable Function AddServiceProperty (name As String, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField) As RuntimeServiceProperty

参数

name
String

要添加的属性的名称。

propertyInfo
PropertyInfo

阴影属性的相应 CLR 属性或 null

fieldInfo
FieldInfo

阴影属性的相应 CLR 字段或 null

propertyAccessMode
PropertyAccessMode

PropertyAccessMode用于此属性的 。

返回

新建的服务属性。

适用于

AddServiceProperty(String, PropertyInfo, FieldInfo, Type, PropertyAccessMode)

向此实体类型添加服务属性。

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty AddServiceProperty (string name, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Type? serviceType = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField);
abstract member AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Type * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
override this.AddServiceProperty : string * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Type * Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.RuntimeServiceProperty
Public Overridable Function AddServiceProperty (name As String, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional serviceType As Type = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField) As RuntimeServiceProperty

参数

name
String

要添加的属性的名称。

propertyInfo
PropertyInfo

阴影属性的相应 CLR 属性或 null

fieldInfo
FieldInfo

阴影属性的相应 CLR 字段或 null

serviceType
Type

服务的类型,或使用 null 成员的类型。

propertyAccessMode
PropertyAccessMode

PropertyAccessMode用于此属性的 。

返回

新建的服务属性。

适用于