IConventionEntityTypeBuilder.GetOrCreateProperties 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
GetOrCreateProperties(IEnumerable<MemberInfo>, Boolean) |
返回与给定成员匹配的现有属性或创建它们。 |
GetOrCreateProperties(IReadOnlyList<String>, Boolean) |
返回具有给定名称的现有属性,如果找到匹配的 CLR 成员,则创建它们。 |
GetOrCreateProperties(IEnumerable<MemberInfo>, Boolean)
返回与给定成员匹配的现有属性或创建它们。
public System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> GetOrCreateProperties (System.Collections.Generic.IEnumerable<System.Reflection.MemberInfo> memberInfos, bool fromDataAnnotation = false);
public System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? GetOrCreateProperties (System.Collections.Generic.IEnumerable<System.Reflection.MemberInfo>? memberInfos, bool fromDataAnnotation = false);
abstract member GetOrCreateProperties : seq<System.Reflection.MemberInfo> * bool -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>
Public Function GetOrCreateProperties (memberInfos As IEnumerable(Of MemberInfo), Optional fromDataAnnotation As Boolean = false) As IReadOnlyList(Of IConventionProperty)
参数
- memberInfos
- IEnumerable<MemberInfo>
类型成员。
- fromDataAnnotation
- Boolean
指示是否使用数据注释指定配置。
返回
如果实体类型上存在属性,则为属性列表, null
否则为 。
适用于
GetOrCreateProperties(IReadOnlyList<String>, Boolean)
返回具有给定名称的现有属性,如果找到匹配的 CLR 成员,则创建它们。
public System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> GetOrCreateProperties (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
public System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>? GetOrCreateProperties (System.Collections.Generic.IReadOnlyList<string>? propertyNames, bool fromDataAnnotation = false);
abstract member GetOrCreateProperties : System.Collections.Generic.IReadOnlyList<string> * bool -> System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty>
Public Function GetOrCreateProperties (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IReadOnlyList(Of IConventionProperty)
参数
- propertyNames
- IReadOnlyList<String>
属性的名称。
- fromDataAnnotation
- Boolean
指示是否使用数据注释指定配置。
返回
如果实体类型上存在属性,则为属性列表, null
否则为 。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈