共用方式為


RuntimeNavigation Class

Definition

Represents a navigation property which can be used to navigate a relationship.

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
Inheritance
Inheritance
Implements

Remarks

See Modeling entity types and relationships for more information and examples.

Constructors

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

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

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

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Properties

ClrType

Gets the type of value that this navigation holds.

DebugView

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

DeclaringEntityType

Gets the entity type that this navigation property belongs to.

DeclaringType

Gets the type that this property-like object belongs to.

DeclaringType

Gets the type that this property-like object belongs to.

(Inherited from RuntimePropertyBase)
ForeignKey

Gets the foreign key that defines the relationship this navigation property will navigate.

IsReadOnly

Indicates whether the current object is read-only.

(Inherited from AnnotatableBase)
Item[String]

Gets the value annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
Item[String]

Gets the value annotation with the given name, returning null if it does not exist.

(Inherited from RuntimeAnnotatableBase)
Name

Gets the name of this property-like object.

(Inherited from RuntimePropertyBase)
Sentinel

Gets the sentinel value that indicates that this property is not set.

Sentinel

Gets the sentinel value that indicates that this property is not set.

(Inherited from RuntimePropertyBase)

Methods

AddAnnotation(String, Annotation)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
AddAnnotations(IEnumerable<IAnnotation>)

Adds annotations to this object.

(Inherited from AnnotatableBase)
AddAnnotations(IEnumerable<IAnnotation>)

Adds annotations to this object overriding any existing annotations with the same name.

(Inherited from RuntimeAnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

Adds annotations to this object.

(Inherited from AnnotatableBase)
AddAnnotations(IReadOnlyDictionary<String,Object>)

Adds annotations to this object overriding any existing annotations with the same name.

(Inherited from RuntimeAnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
AddRuntimeAnnotation(String, Annotation)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

Adds runtime annotations to this object.

(Inherited from AnnotatableBase)
AddRuntimeAnnotations(IEnumerable<Annotation>)

Adds runtime annotations to this object.

(Inherited from RuntimeAnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

Adds runtime annotations to this object.

(Inherited from AnnotatableBase)
AddRuntimeAnnotations(IReadOnlyDictionary<String,Object>)

Adds runtime annotations to this object.

(Inherited from RuntimeAnnotatableBase)
CreateAnnotation(String, Object)

Creates a new annotation.

(Inherited from AnnotatableBase)
CreateAnnotation(String, Object)

Creates a new annotation.

(Inherited from RuntimeAnnotatableBase)
CreateRuntimeAnnotation(String, Object)

Creates a new runtime annotation.

(Inherited from AnnotatableBase)
CreateRuntimeAnnotation(String, Object)

Creates a new runtime annotation.

(Inherited from RuntimeAnnotatableBase)
EnsureMutable()

Throws if the model is read-only.

(Inherited from AnnotatableBase)
EnsureReadOnly()

Throws if the model is not read-only.

(Inherited from AnnotatableBase)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from RuntimeAnnotatableBase)
FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

(Inherited from RuntimeAnnotatableBase)
GetAnnotation(String)

Gets the annotation with the given name, throwing if it does not exist.

(Inherited from AnnotatableBase)
GetAnnotation(String)

Gets the annotation with the given name, throwing if it does not exist.

(Inherited from RuntimeAnnotatableBase)
GetAnnotations()

Gets all annotations on the current object.

(Inherited from AnnotatableBase)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

Gets the value of the runtime annotation with the given name, adding it if one does not exist.

(Inherited from AnnotatableBase)
GetOrAddRuntimeAnnotationValue<TValue,TArg>(String, Func<TArg,TValue>, TArg)

Gets the value of the runtime annotation with the given name, adding it if one does not exist.

(Inherited from RuntimeAnnotatableBase)
GetRuntimeAnnotations()

Gets all runtime annotations on the current object.

(Inherited from AnnotatableBase)
GetRuntimeAnnotations()

Gets all runtime annotations on the current object.

(Inherited from RuntimeAnnotatableBase)
OnAnnotationSet(String, Annotation, Annotation)

Called when an annotation was set or removed.

(Inherited from AnnotatableBase)
RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from AnnotatableBase)
RemoveAnnotation(String)

Removes the given annotation from this object.

(Inherited from RuntimeAnnotatableBase)
RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from AnnotatableBase)
RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from RuntimeAnnotatableBase)
SetAccessors(PropertyAccessors)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from RuntimePropertyBase)
SetAccessors<TProperty>(Func<InternalEntityEntry,TProperty>, Func<InternalEntityEntry, TProperty>, Func<InternalEntityEntry,TProperty>, Func<InternalEntityEntry, TProperty>, Func<ValueBuffer,Object>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from RuntimePropertyBase)
SetAnnotation(String, Annotation, Annotation)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
SetAnnotation(String, Object)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
SetAnnotation(String, Object)

Sets the annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
SetCollectionAccessor<TEntity,TCollection,TElement>(Func<TEntity, TCollection>, Action<TEntity,TCollection>, Action<TEntity,TCollection>, Func<TEntity,Action<TEntity,TCollection>,TCollection>, Func<TCollection>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

SetCurrentValueComparer(IComparer<IUpdateEntry>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from RuntimePropertyBase)
SetGetter<TEntity,TStructuralType,TValue>(Func<TEntity,TValue>, Func<TEntity,Boolean>, Func<TStructuralType,TValue>, Func<TStructuralType,Boolean>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from RuntimePropertyBase)
SetMaterializationSetter<TEntity,TValue>(Action<TEntity,TValue>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from RuntimePropertyBase)
SetPropertyIndexes(Int32, Int32, Int32, Int32, Int32)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from RuntimePropertyBase)
SetRuntimeAnnotation(String, Annotation, Annotation)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
SetRuntimeAnnotation(String, Annotation, Annotation)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
SetSetter<TEntity,TValue>(Action<TEntity,TValue>)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

(Inherited from RuntimePropertyBase)
ToString()

Returns a string that represents the current object.

Explicit Interface Implementations

IAnnotatable.AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
IAnnotatable.AddRuntimeAnnotation(String, Object)

Adds a runtime annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
IAnnotatable.FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
IAnnotatable.FindRuntimeAnnotation(String)

Gets the runtime annotation with the given name, returning null if it does not exist.

(Inherited from RuntimeAnnotatableBase)
IAnnotatable.GetRuntimeAnnotations()

Gets all the runtime annotations on the current object.

(Inherited from AnnotatableBase)
IAnnotatable.GetRuntimeAnnotations()

Gets all the runtime annotations on the current object.

(Inherited from RuntimeAnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from AnnotatableBase)
IAnnotatable.RemoveRuntimeAnnotation(String)

Removes the given runtime annotation from this object.

(Inherited from RuntimeAnnotatableBase)
IAnnotatable.SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from AnnotatableBase)
IAnnotatable.SetRuntimeAnnotation(String, Object)

Sets the runtime annotation stored under the given key. Overwrites the existing annotation if an annotation with the specified name already exists.

(Inherited from RuntimeAnnotatableBase)
INavigationBase.GetCollectionAccessor()

Gets the IClrCollectionAccessor for this navigation property, if it's a collection navigation.

IPropertyBase.GetCurrentValueComparer()

Gets a IComparer<T> for comparing values in tracked IUpdateEntry entries.

(Inherited from RuntimePropertyBase)
IPropertyBase.GetGetter()

Gets a IClrPropertyGetter for reading the value of this property.

(Inherited from RuntimePropertyBase)
IReadOnlyAnnotatable.FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
IReadOnlyAnnotatable.FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from RuntimeAnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

Gets all annotations on the current object.

(Inherited from AnnotatableBase)
IReadOnlyAnnotatable.GetAnnotations()

Gets all annotations on the current object.

(Inherited from RuntimeAnnotatableBase)
IReadOnlyAnnotatable.Item[String]

Gets the value of the annotation with the given name, returning null if it does not exist.

(Inherited from AnnotatableBase)
IReadOnlyAnnotatable.Item[String]

Gets the value of the annotation with the given name, returning null if it does not exist.

(Inherited from RuntimeAnnotatableBase)
IReadOnlyNavigation.ForeignKey

Gets the foreign key that defines the relationship this navigation property will navigate.

IReadOnlyPropertyBase.ClrType

Gets the type of value that this property-like object holds.

(Inherited from RuntimePropertyBase)
IReadOnlyPropertyBase.DeclaringType

Gets the type that this property-like object belongs to.

(Inherited from RuntimePropertyBase)
IReadOnlyPropertyBase.FieldInfo

Gets the FieldInfo for the underlying CLR field for this property-like object. This may be null for shadow properties or if the backing field is not known.

(Inherited from RuntimePropertyBase)
IReadOnlyPropertyBase.GetPropertyAccessMode()

Gets the PropertyAccessMode being used for this property-like object.

(Inherited from RuntimePropertyBase)
IReadOnlyPropertyBase.PropertyInfo

Gets the PropertyInfo for the underlying CLR property for this property-like object. This may be null for shadow properties or if mapped directly to a field.

(Inherited from RuntimePropertyBase)
IRuntimePropertyBase.Accessors (Inherited from RuntimePropertyBase)
IRuntimePropertyBase.GetSetter() (Inherited from RuntimePropertyBase)
IRuntimePropertyBase.MaterializationSetter (Inherited from RuntimePropertyBase)
IRuntimePropertyBase.PropertyIndexes (Inherited from RuntimePropertyBase)
IRuntimePropertyBase.Setter (Inherited from RuntimePropertyBase)

Extension Methods

AnnotationsToDebugString(IAnnotatable, Int32)

Gets the debug string for all annotations declared on the object.

SetIsLoadedWhenNoTracking(INavigationBase, Object)

Calls SetLoaded(Object, String, Boolean) for a INavigationBase to mark it as loaded when a no-tracking query has eagerly loaded this relationship.

FindInverse(INavigation)
Obsolete.
Obsolete.

Gets the navigation property on the other end of the relationship. Returns null if there is no navigation property defined on the other end of the relationship.

GetCollectionAccessor(INavigation)

Gets the IClrCollectionAccessor for this navigation property, which must be a collection navigation.

GetTargetType(INavigation)
Obsolete.
Obsolete.

Gets the entity type that a given navigation property will hold an instance of (or hold instances of if it is a collection navigation).

IsCollection(INavigation)
Obsolete.
Obsolete.

Gets a value indicating whether the given navigation property is a collection property.

IsDependentToPrincipal(INavigation)
Obsolete.
Obsolete.

Gets a value indicating whether the given navigation property is the navigation property on the dependent entity type that points to the principal entity.

IsEagerLoaded(INavigation)
Obsolete.
Obsolete.

Gets a value indicating whether this navigation should be eager loaded by default.

ToDebugString(INavigation, MetadataDebugStringOptions, Int32)

Creates a human-readable representation of the given metadata.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

GetCurrentValueComparer(IPropertyBase)

Gets a IComparer<T> for comparing values in tracked IUpdateEntry entries.

GetGetter(IPropertyBase)

Gets a IClrPropertyGetter for reading the value of this property.

Note that it is an error to call this method for a shadow property (IsShadowProperty(IPropertyBase)) since such a property has no associated MemberInfo.

GetIndex(IPropertyBase)

Gets the property index for this property.

GetMemberInfo(IPropertyBase, Boolean, Boolean)

Gets the PropertyInfo or FieldInfo that should be used to get or set a value for the given property.

Note that it is an error to call this method for a shadow property (IsShadowProperty(IPropertyBase)) since such a property has no associated MemberInfo.

IsIndexerProperty(IPropertyBase)

Gets a value indicating whether this is an indexer property. An indexer property is one that is accessed through an indexer on the entity class.

IsShadowProperty(IPropertyBase)
Obsolete.

Gets a value indicating whether this is a shadow property. A shadow property is one that does not have a corresponding property in the entity class. The current value for the property is stored in the ChangeTracker rather than being stored in instances of the entity class.

GetDataAnnotations(INavigation, IAnnotationCodeGenerator)

Gets the data annotations to configure a navigation property.

Applies to