RuntimeNavigation 類別

定義

表示可用來巡覽關聯性的導覽屬性。

public class RuntimeNavigation : Microsoft.EntityFrameworkCore.Metadata.RuntimePropertyBase, Microsoft.EntityFrameworkCore.Metadata.INavigation
type RuntimeNavigation = class
    inherit RuntimePropertyBase
    interface INavigation
    interface IReadOnlyNavigation
    interface IReadOnlyNavigationBase
    interface IReadOnlyPropertyBase
    interface IReadOnlyAnnotatable
    interface INavigationBase
    interface IPropertyBase
    interface IAnnotatable
Public Class RuntimeNavigation
Inherits RuntimePropertyBase
Implements INavigation
繼承
實作

備註

如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。

建構函式

RuntimeNavigation(String, Type, PropertyInfo, FieldInfo, RuntimeForeignKey, PropertyAccessMode, Boolean)

這是支援 Entity Framework Core 基礎結構的內部 API,不受與公用 API 相同的相容性標準。 它可能會在任何版本中變更或移除,而不會有任何通知。 您應該只在程式碼中直接使用它,並知道這麼做可能會導致應用程式在更新至新的 Entity Framework Core 版本時失敗。

RuntimeNavigation(String, Type, PropertyInfo, FieldInfo, RuntimeForeignKey, PropertyAccessMode, Boolean, Boolean)

這是支援 Entity Framework Core 基礎結構的內部 API,不受與公用 API 相同的相容性標準。 它可能會在任何版本中變更或移除,而不會有任何通知。 您應該只在程式碼中直接使用它,並知道這麼做可能會導致應用程式在更新至新的 Entity Framework Core 版本時失敗。

屬性

ClrType

取得這個導覽所保存的值型別。

DebugView

這是支援 Entity Framework Core 基礎結構的內部 API,不受與公用 API 相同的相容性標準。 它可能會在任何版本中變更或移除,而不會有任何通知。 您應該只在程式碼中直接使用它,並知道這麼做可能會導致應用程式在更新至新的 Entity Framework Core 版本時失敗。

DeclaringEntityType

取得此導覽屬性所屬的實體類型。

DeclaringType

取得這個類似屬性的物件所屬的類型。

DeclaringType

取得這個類似屬性的物件所屬的類型。

(繼承來源 RuntimePropertyBase)
ForeignKey

取得定義這個導覽屬性將巡覽之關聯性的外鍵。

IsReadOnly

指出目前物件是否為唯讀。

(繼承來源 AnnotatableBase)
Item[String]

取得具有指定名稱的值批註,如果不存在,則 null 傳回 。

(繼承來源 AnnotatableBase)
Name

取得這個類似屬性的物件名稱。

(繼承來源 RuntimePropertyBase)
Sentinel

取得 sentinel 值,這個值表示這個屬性未設定。

Sentinel

取得 sentinel 值,這個值表示這個屬性未設定。

(繼承來源 RuntimePropertyBase)

方法

AddAnnotation(String, Annotation)

將注釋加入至這個物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 AnnotatableBase)
AddAnnotation(String, Object)

將注釋加入至這個物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 AnnotatableBase)
AddAnnotations(IEnumerable<IAnnotation>)

將批註加入至這個 物件。

(繼承來源 AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

將批註加入至這個 物件。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

將執行時間批註新增至這個 物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotation(String, Object)

將執行時間批註新增至這個 物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

將執行時間批註新增至這個 物件。

(繼承來源 AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

將執行時間批註新增至這個 物件。

(繼承來源 AnnotatableBase)
CreateAnnotation(String, Object)

建立新的批註。

(繼承來源 AnnotatableBase)
CreateRuntimeAnnotation(String, Object)

建立新的執行時間批註。

(繼承來源 AnnotatableBase)
EnsureMutable()

如果模型是唯讀的,則會擲回 。

(繼承來源 AnnotatableBase)
EnsureReadOnly()

如果模型不是唯讀,則會擲回 。

(繼承來源 AnnotatableBase)
FindAnnotation(String)

取得具有指定名稱的注釋,如果不存在,則傳 null 回 。

(繼承來源 AnnotatableBase)
FindRuntimeAnnotation(String)

取得具有指定名稱的執行時間批註,如果不存在,則 null 傳回 。

(繼承來源 AnnotatableBase)
GetAnnotation(String)

取得具有指定名稱的注釋,如果不存在,則會擲回。

(繼承來源 AnnotatableBase)
GetAnnotations()

取得目前 物件上的所有批註。

(繼承來源 AnnotatableBase)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

取得具有指定名稱的執行時間批註值,如果不存在,請加以新增。

(繼承來源 AnnotatableBase)
GetRuntimeAnnotations()

取得目前 物件上的所有執行時間批註。

(繼承來源 AnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

設定或移除注釋時呼叫。

(繼承來源 AnnotatableBase)
RemoveAnnotation(String)

從這個 物件中移除指定的批註。

(繼承來源 AnnotatableBase)
RemoveRuntimeAnnotation(String)

從這個 物件中移除指定的執行時間批註。

(繼承來源 AnnotatableBase)
SetAccessors(PropertyAccessors)

這是支援 Entity Framework Core 基礎結構的內部 API,不受與公用 API 相同的相容性標準。 它可能會在任何版本中變更或移除,而不會有任何通知。 您應該只在程式碼中直接使用它,並知道這麼做可能會導致應用程式在更新至新的 Entity Framework Core 版本時失敗。

(繼承來源 RuntimePropertyBase)
SetAnnotation(String, Annotation, Annotation)

設定儲存在指定索引鍵底下的批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 AnnotatableBase)
SetAnnotation(String, Object)

設定儲存在指定索引鍵底下的批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 AnnotatableBase)
SetGetter<TEntity,TStructuralType,TValue>(Func<TEntity,TValue>, Func<TEntity,Boolean>, Func<TStructuralType,TValue>, Func<TStructuralType,Boolean>)

這是支援 Entity Framework Core 基礎結構的內部 API,不受與公用 API 相同的相容性標準。 它可能會在任何版本中變更或移除,而不會有任何通知。 您應該只在程式碼中直接使用它,並知道這麼做可能會導致應用程式在更新至新的 Entity Framework Core 版本時失敗。

(繼承來源 RuntimePropertyBase)
SetRuntimeAnnotation(String, Annotation, Annotation)

設定儲存在指定索引鍵底下的執行時間批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 AnnotatableBase)
SetRuntimeAnnotation(String, Object)

設定儲存在指定索引鍵底下的執行時間批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 AnnotatableBase)
SetSetter<TEntity,TValue>(Action<TEntity,TValue>)

這是支援 Entity Framework Core 基礎結構的內部 API,不受與公用 API 相同的相容性標準。 它可能會在任何版本中變更或移除,而不會有任何通知。 您應該只在程式碼中直接使用它,並知道這麼做可能會導致應用程式在更新至新的 Entity Framework Core 版本時失敗。

(繼承來源 RuntimePropertyBase)
ToString()

傳回代表目前物件的字串。

明確介面實作

IAnnotatable.AddRuntimeAnnotation(String, Object)

將執行時間批註新增至這個 物件。 如果具有指定名稱的注釋已經存在,則會擲回 。

(繼承來源 AnnotatableBase)
IAnnotatable.FindRuntimeAnnotation(String)

取得具有指定名稱的執行時間批註,如果不存在,則 null 傳回 。

(繼承來源 AnnotatableBase)
IAnnotatable.GetRuntimeAnnotations()

取得目前 物件上的所有執行時間批註。

(繼承來源 AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

從這個 物件中移除指定的執行時間批註。

(繼承來源 AnnotatableBase)
IAnnotatable.SetRuntimeAnnotation(String, Object)

設定儲存在指定索引鍵底下的執行時間批註。 如果具有指定名稱的注釋已經存在,則會覆寫現有的批註。

(繼承來源 AnnotatableBase)
INavigationBase.GetCollectionAccessor()

IClrCollectionAccessor取得這個導覽屬性的 ,如果是集合導覽。

IPropertyBase.GetCurrentValueComparer()

取得 , IComparer<T> 用於比較追蹤 IUpdateEntry 專案中的值。

(繼承來源 RuntimePropertyBase)
IPropertyBase.GetGetter()

IClrPropertyGetter取得 ,用於讀取這個屬性的值。

(繼承來源 RuntimePropertyBase)
IReadOnlyAnnotatable.FindAnnotation(String)

取得具有指定名稱的注釋,如果不存在,則傳 null 回 。

(繼承來源 AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

取得目前 物件上的所有批註。

(繼承來源 AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

取得具有指定名稱之注釋的值,如果不存在,則傳 null 回 。

(繼承來源 AnnotatableBase)
IReadOnlyNavigation.ForeignKey

取得定義這個導覽屬性將巡覽之關聯性的外鍵。

IReadOnlyPropertyBase.ClrType

取得這個類似屬性的物件所保存的值型別。

(繼承來源 RuntimePropertyBase)
IReadOnlyPropertyBase.DeclaringType

取得這個類似屬性的物件所屬的類型。

(繼承來源 RuntimePropertyBase)
IReadOnlyPropertyBase.FieldInfo

FieldInfo取得此屬性類似物件之基礎 CLR 欄位的 。 這可能 null 適用于陰影屬性,或如果不知道支援欄位。

(繼承來源 RuntimePropertyBase)
IReadOnlyPropertyBase.GetPropertyAccessMode()

PropertyAccessMode取得用於這個屬性類似物件的 。

(繼承來源 RuntimePropertyBase)
IReadOnlyPropertyBase.PropertyInfo

PropertyInfo取得此屬性類似物件之基礎 CLR 屬性的 。 這可能 null 適用于陰影屬性,如果直接對應至欄位,則為 。

(繼承來源 RuntimePropertyBase)
IRuntimePropertyBase.Accessors

表示可用來巡覽關聯性的導覽屬性。

(繼承來源 RuntimePropertyBase)
IRuntimePropertyBase.GetSetter()

表示可用來巡覽關聯性的導覽屬性。

(繼承來源 RuntimePropertyBase)
IRuntimePropertyBase.MaterializationSetter

表示可用來巡覽關聯性的導覽屬性。

(繼承來源 RuntimePropertyBase)
IRuntimePropertyBase.PropertyIndexes

表示可用來巡覽關聯性的導覽屬性。

(繼承來源 RuntimePropertyBase)
IRuntimePropertyBase.Setter

表示可用來巡覽關聯性的導覽屬性。

(繼承來源 RuntimePropertyBase)

擴充方法

AnnotationsToDebugString(IAnnotatable, Int32)

取得 物件上宣告之所有注釋的偵錯字串。

SetIsLoadedWhenNoTracking(INavigationBase, Object)

呼叫 SetLoaded(Object, String, Boolean)INavigationBase 以在無追蹤查詢已積極載入此關聯性時將其標示為已載入。

FindInverse(INavigation)
已過時。.
已過時。.

取得關聯性另一端的導覽屬性。 如果沒有定義于關聯性另一端的導覽屬性,則傳回 null。

GetCollectionAccessor(INavigation)

IClrCollectionAccessor取得這個導覽屬性的 ,這個屬性必須是集合導覽。

GetTargetType(INavigation)
已過時。.
已過時。.

取得指定的導覽屬性會保存實例的實體類型 (,如果實例是集合導覽) ,則為 的實例。

IsCollection(INavigation)
已過時。.
已過時。.

取得值,指出指定的導覽屬性是否為集合屬性。

IsDependentToPrincipal(INavigation)
已過時。.
已過時。.

取得值,指出指定的導覽屬性是否為指向主體實體之相依實體類型的導覽屬性。

IsEagerLoaded(INavigation)
已過時。.
已過時。.

取得值,指出此導覽是否應該預設為積極式載入。

ToDebugString(INavigation, MetadataDebugStringOptions, Int32)

建立人類可讀取的指定中繼資料標記法。

警告:不要依賴傳回字串的格式。 它專為偵錯而設計,而且可能會在發行之間任意變更。

GetCurrentValueComparer(IPropertyBase)

取得 , IComparer<T> 用於比較追蹤 IUpdateEntry 專案中的值。

GetGetter(IPropertyBase)

IClrPropertyGetter取得 ,用於讀取這個屬性的值。

請注意,針對陰影屬性呼叫這個方法 () IsShadowProperty(IPropertyBase) 是一個錯誤,因為這類屬性沒有相關聯的 MemberInfo

GetIndex(IPropertyBase)

取得這個屬性的屬性索引。

GetMemberInfo(IPropertyBase, Boolean, Boolean)

取得 或 PropertyInfoFieldInfo ,這個值應該用來取得或設定指定屬性的值。

請注意,針對陰影屬性呼叫這個方法 () IsShadowProperty(IPropertyBase) 是一個錯誤,因為這類屬性沒有相關聯的 MemberInfo

IsIndexerProperty(IPropertyBase)

取得值,指出這個 是否為索引子屬性。 索引子屬性是透過實體類別上的索引子存取的屬性。

IsShadowProperty(IPropertyBase)
已過時。.

取得值,指出這個 是否為陰影屬性。 陰影屬性是實體類別中沒有對應屬性的陰影屬性。 屬性的目前值會儲存在 中 ChangeTracker ,而不是儲存在實體類別的實例中。

GetDataAnnotations(INavigation, IAnnotationCodeGenerator)

取得要設定導覽屬性的資料批註。

適用於