ConventionTypeBaseExtensions.SetNavigationAccessMode 方法

定义

PropertyAccessMode设置要用于此实体类型的导航的 。

请注意,单个导航可以替代此访问模式。 此处设置的值将用于未指定替代的任何导航。

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

参数

entityType
IConventionTypeBase

要为其设置访问模式的类型。

propertyAccessMode
Nullable<PropertyAccessMode>

PropertyAccessModenull 用于清除模式集。

fromDataAnnotation
Boolean

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

返回

配置的值。

适用于