语言

ConventionPropertyBaseExtensions.SetPropertyAccessMode 方法

定义

PropertyAccessMode设置要用于此属性的项。

public static void SetPropertyAccessMode(this Microsoft.EntityFrameworkCore.Metadata.IConventionPropertyBase property, Microsoft.EntityFrameworkCore.PropertyAccessMode? propertyAccessMode, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.PropertyAccessMode? SetPropertyAccessMode(this Microsoft.EntityFrameworkCore.Metadata.IConventionPropertyBase property, Microsoft.EntityFrameworkCore.PropertyAccessMode? propertyAccessMode, bool fromDataAnnotation = false);
static member SetPropertyAccessMode : Microsoft.EntityFrameworkCore.Metadata.IConventionPropertyBase * Nullable<Microsoft.EntityFrameworkCore.PropertyAccessMode> * bool -> unit
static member SetPropertyAccessMode : Microsoft.EntityFrameworkCore.Metadata.IConventionPropertyBase * Nullable<Microsoft.EntityFrameworkCore.PropertyAccessMode> * bool -> Nullable<Microsoft.EntityFrameworkCore.PropertyAccessMode>
<Extension()>
Public Sub SetPropertyAccessMode (property As IConventionPropertyBase, propertyAccessMode As Nullable(Of PropertyAccessMode), Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetPropertyAccessMode (property As IConventionPropertyBase, propertyAccessMode As Nullable(Of PropertyAccessMode), Optional fromDataAnnotation As Boolean = false) As Nullable(Of PropertyAccessMode)

参数

property
IConventionPropertyBase

要为其设置访问模式的属性。

propertyAccessMode
Nullable<PropertyAccessMode>

要 PropertyAccessMode清除模式集的 null。

fromDataAnnotation
Boolean

指示是否使用数据注释指定了配置。

返回

配置的值。

适用于