RuntimeEntityType.AddServiceProperty 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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用于此属性的 。
返回
新建的服务属性。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈