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