语言

IConventionNavigationBase 接口

定义

表示可用于导航关系的导航属性。

public interface IConventionNavigationBase : Microsoft.EntityFrameworkCore.Metadata.IConventionPropertyBase, Microsoft.EntityFrameworkCore.Metadata.IReadOnlyNavigationBase
public interface IConventionNavigationBase : Microsoft.EntityFrameworkCore.Metadata.IConventionPropertyBase, Microsoft.EntityFrameworkCore.Metadata.INavigationBase
type IConventionNavigationBase = interface
    interface IReadOnlyNavigationBase
    interface IReadOnlyPropertyBase
    interface IReadOnlyAnnotatable
    interface IConventionPropertyBase
    interface IConventionAnnotatable
type IConventionNavigationBase = interface
    interface INavigationBase
    interface IPropertyBase
    interface IAnnotatable
    interface IConventionPropertyBase
    interface IConventionAnnotatable
Public Interface IConventionNavigationBase
Implements IConventionPropertyBase, IReadOnlyNavigationBase
Public Interface IConventionNavigationBase
Implements IConventionPropertyBase, INavigationBase
派生
实现

注解

此接口在创建模型期间使用,并允许修改元数据。 生成模型后, IReadOnlyNavigationBase 表示相同元数据的只读视图。

有关详细信息和示例,请参阅 模型生成约定 。

属性

名称 说明
Builder

获取可用于配置此对象的生成器。

(继承自 IConventionAnnotatable)
ClrType

获取此属性类对象保存的值的类型。

(继承自 IPropertyBase)
DeclaringEntityType
已过时.

获取此属性所属的实体类型。

(继承自 IPropertyBase)
DeclaringType

获取此属性类对象所属的类型。

(继承自 IPropertyBase)
FieldInfo

获取 FieldInfo 此属性类似对象的基础 CLR 字段。 这可能 null 适用于阴影属性,或者如果支持字段未知。

(继承自 IPropertyBase)
Inverse

获取反转导航。

(继承自 INavigationBase)
IsCollection

获取一个值,该值指示导航属性是否为集合属性。

(继承自 INavigationBase)
IsEagerLoaded

获取一个值,该值指示默认情况下是否应预先加载此导航。

(继承自 INavigationBase)
IsInModel

指示此对象是否在模型中,即尚未从一个模型中删除。

(继承自 IConventionAnnotatable)
IsShadowProperty

获取一个值,该值指示这是否为阴影属性。 阴影属性是实体类中没有相应属性的阴影属性。 该属性的当前值存储在实体类的实例中 ChangeTracker ,而不是存储在实体类的实例中。

(继承自 IPropertyBase)
Item[String]

获取具有给定名称的值批注,如果不存在,则 null 返回该值。

(继承自 IAnnotatable)
LazyLoadingEnabled

确定是否启用延迟加载并且模型中配置了延迟加载的机制,则此导航是否应延迟加载。

(继承自 IReadOnlyNavigationBase)
Name

获取类似于此属性的对象的名称。

(继承自 IPropertyBase)
PropertyInfo

获取 PropertyInfo 此属性类似对象的基础 CLR 属性。 这可能 null 适用于阴影属性,或者如果直接映射到字段。

(继承自 IPropertyBase)
Sentinel

获取指示未设置此属性的 sentinel 值。

(继承自 IReadOnlyPropertyBase)
TargetEntityType

获取此导航属性将保存其实例的实体类型。

方法

名称 说明
AddAnnotation(String, Object, Boolean)

向此对象添加批注。 如果具有指定名称的批注已存在,则引发。

(继承自 IConventionAnnotatable)
AddAnnotations(IEnumerable<IConventionAnnotation>, Boolean)

向对象添加批注。

(继承自 IConventionAnnotatable)
AddRuntimeAnnotation(String, Object)

向此对象添加运行时批注。 如果具有指定名称的批注已存在,则引发。

(继承自 IAnnotatable)
AnnotationsToDebugString(Int32)

获取针对对象上声明的所有批注的调试字符串。

(继承自 IReadOnlyAnnotatable)
FindAnnotation(String)

获取具有给定名称的批注,如果不存在,则 null 返回。

(继承自 IAnnotatable)
FindRuntimeAnnotation(String)

获取具有给定名称的运行时批注,如果不存在,则 null 返回。

(继承自 IAnnotatable)
FindRuntimeAnnotationValue(String)

获取具有给定名称的运行时批注的值,如果不存在,则 null 返回该值。

(继承自 IAnnotatable)
GetAnnotation(String)

获取具有给定名称的批注,如果不存在,则引发该批注。

(继承自 IConventionAnnotatable)
GetAnnotations()

获取当前对象上的所有批注。

(继承自 IAnnotatable)
GetCollectionAccessor()

获取 IClrCollectionAccessor 此属性(如果是集合导航或复杂属性)。

(继承自 IPropertyBase)
GetConfigurationSource()

返回此属性的配置源。

(继承自 IConventionPropertyBase)
GetCurrentValueComparer()

获取用于 IComparer<T> 比较跟踪 IUpdateEntry 条目中的值。

(继承自 IPropertyBase)
GetFieldInfoConfigurationSource()

返回用于 . 的配置 FieldInfo源。

(继承自 IConventionPropertyBase)
GetFieldName()

获取此属性的后盾字段的名称,或者 null 如果后盾字段未知。

(继承自 IReadOnlyPropertyBase)
GetGetter()

获取一个 IClrPropertyGetter 用于读取此属性的值。

(继承自 IPropertyBase)
GetIndex()

获取此属性的属性索引。

(继承自 IPropertyBase)
GetIsEagerLoadedConfigurationSource()

返回用于 . 的配置 IsEagerLoaded源。

GetLazyLoadingEnabledConfigurationSource()

返回用于 . 的配置 LazyLoadingEnabled源。

GetMemberInfo(Boolean, Boolean)

PropertyInfo FieldInfo获取或用于获取或设置给定属性的值。

(继承自 IPropertyBase)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

获取具有给定名称的运行时批注的值,如果不存在,则添加它。

(继承自 IAnnotatable)
GetPropertyAccessMode()

PropertyAccessMode获取用于此属性的用途。 null 指示正在使用默认属性访问模式。

(继承自 IPropertyBase)
GetPropertyAccessModeConfigurationSource()

返回用于 . 的配置 GetPropertyAccessMode()源。

(继承自 IConventionPropertyBase)
GetRuntimeAnnotations()

获取当前对象上的所有运行时批注。

(继承自 IAnnotatable)
IsIndexerProperty()

获取一个值,该值指示这是否为索引器属性。 索引器属性是通过实体类上的索引器访问的。

(继承自 IReadOnlyPropertyBase)
RemoveAnnotation(String)

从此对象中删除具有给定名称的批注。

(继承自 IConventionAnnotatable)
RemoveRuntimeAnnotation(String)

从此对象中删除给定的运行时批注。

(继承自 IAnnotatable)
SetAnnotation(String, Object, Boolean)

设置存储在给定名称下的批注。 如果已存在具有指定名称的批注,则覆盖现有批注。

(继承自 IConventionAnnotatable)
SetField(FieldInfo, Boolean)
已过时.

设置 FieldInfo 此属性应使用的基础 CLR 字段。

默认情况下,如果找到或指定了后盾字段,则当构造新对象时使用,通常是从数据库查询实体时。 属性用于所有其他访问。 可以通过调用 SetPropertyAccessMode(Nullable<PropertyAccessMode>, Boolean)来更改此更改。

(继承自 IConventionPropertyBase)
SetField(String, Boolean)

设置此属性应使用的基础 CLR 字段。 这可能 null 适用于阴影属性,或者属性的后盾字段未知。

(继承自 IConventionPropertyBase)
SetFieldInfo(FieldInfo, Boolean)

设置 FieldInfo 此属性应使用的基础 CLR 字段。

(继承自 IConventionPropertyBase)
SetIsEagerLoaded(Nullable<Boolean>, Boolean)

设置一个值,该值指示默认情况下是否应预先加载此导航。

SetIsLoadedWhenNoTracking(Object)

当无跟踪查询急切地加载此关系时,调用SetLoaded(Object, String, Boolean)INavigationBase将其标记为已加载。

(继承自 INavigationBase)
SetLazyLoadingEnabled(Nullable<Boolean>, Boolean)

设置一个值,该值指示是否应延迟加载此导航,如果启用延迟加载并就地加载。

SetOrRemoveAnnotation(String, Object, Boolean)

设置存储在给定名称下的批注。 如果已存在具有指定名称的批注,则覆盖现有批注。 如果 null 已提供,则删除现有批注。

(继承自 IConventionAnnotatable)
SetPropertyAccessMode(Nullable<PropertyAccessMode>, Boolean)

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

(继承自 IConventionPropertyBase)
SetRuntimeAnnotation(String, Object)

设置存储在给定密钥下的运行时批注。 如果已存在具有指定名称的批注,则覆盖现有批注。

(继承自 IAnnotatable)

显式接口实现

名称 说明
IPropertyBase.GetPropertyAccessMode()

PropertyAccessMode获取用于此属性的用途。 null 指示正在使用默认属性访问模式。

(继承自 INavigationBase)
IReadOnlyPropertyBase.IsShadowProperty()

获取一个值,该值指示这是否为阴影属性。 阴影属性是实体类中没有相应属性的阴影属性。 该属性的当前值存储在实体类的实例中 ChangeTracker ,而不是存储在实体类的实例中。

(继承自 IReadOnlyNavigationBase)

扩展方法

名称 说明
AddAnnotations(IConventionAnnotatable, IEnumerable<IConventionAnnotation>, Boolean)

向对象添加批注。

AnnotationsToDebugString(IAnnotatable, Int32)

获取针对对象上声明的所有批注的调试字符串。

GetAnnotation(IAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

GetAnnotation(IConventionAnnotatable, String)

获取具有给定名称的批注,如果不存在,则引发该批注。

GetCurrentValueComparer(IPropertyBase)

获取用于 IComparer<T> 比较跟踪 IUpdateEntry 条目中的值。

GetFieldName(IPropertyBase)

获取此属性的后盾字段的名称,或者 null 如果后盾字段未知。

GetGetter(IPropertyBase)

获取一个 IClrPropertyGetter 用于读取此属性的值。

请注意,对于阴影属性(IsShadowProperty(IPropertyBase))调用此方法是一个错误,因为此类属性没有关联 MemberInfo。

GetIndex(IPropertyBase)

获取此属性的属性索引。

GetMemberInfo(IPropertyBase, Boolean, Boolean)

PropertyInfo FieldInfo获取或用于获取或设置给定属性的值。

请注意,对于阴影属性(IsShadowProperty(IPropertyBase))调用此方法是一个错误,因为此类属性没有关联 MemberInfo。

GetPropertyAccessModeConfigurationSource(IConventionPropertyBase)

返回用于 . 的配置 GetPropertyAccessMode()源。

IsIndexerProperty(IPropertyBase)

获取一个值,该值指示这是否为索引器属性。 索引器属性是通过实体类上的索引器访问的。

IsShadowProperty(IPropertyBase)
已过时.

获取一个值,该值指示这是否为阴影属性。 阴影属性是实体类中没有相应属性的阴影属性。 该属性的当前值存储在实体类的实例中 ChangeTracker ,而不是存储在实体类的实例中。

SetField(IConventionPropertyBase, String, Boolean)

设置此属性应使用的基础 CLR 字段。 这可能 null 适用于阴影属性,或者属性的后盾字段未知。

支持字段通常按约定找到,如下所述: http://go.microsoft.com/fwlink/?LinkId=723277. 在约定找不到正确的字段的情况下,此方法可用于显式设置支持字段。

默认情况下,如果找到或指定了后盾字段,则当构造新对象时使用,通常是从数据库查询实体时。 属性用于所有其他访问。 可以通过调用 SetPropertyAccessMode(IConventionPropertyBase, Nullable<PropertyAccessMode>, Boolean)来更改此更改。

SetIsLoadedWhenNoTracking(INavigationBase, Object)

当无跟踪查询急切地加载此关系时,调用SetLoaded(Object, String, Boolean)INavigationBase将其标记为已加载。

SetOrRemoveAnnotation(IConventionAnnotatable, String, Object, Boolean)

设置存储在给定名称下的批注。 如果已存在具有指定名称的批注,则覆盖现有批注。 如果 null 已提供,则删除现有批注。

SetPropertyAccessMode(IConventionPropertyBase, Nullable<PropertyAccessMode>, Boolean)

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

适用于