DbCollectionEntry.IsLoaded Property

Definition

Gets or sets a value indicating whether all entities of this collection have been loaded from the database.

public bool IsLoaded { get; set; }
member this.IsLoaded : bool with get, set
Public Property IsLoaded As Boolean

Property Value

true if all the related entities are loaded or the IsLoaded has been explicitly set to true; otherwise, false.

Remarks

Loading the related entities from the database either using lazy-loading, as part of a query, or explicitly with one of the Load methods will set the IsLoaded flag to true. IsLoaded can be explicitly set to true to prevent the related entities of this collection from being lazy-loaded. This can be useful if the application has caused a subset of related entities to be loaded into this collection and wants to prevent any other entities from being loaded automatically. Note that explict loading using one of the Load methods will load all related entities from the database regardless of whether or not IsLoaded is true. When any related entity in the collection is detached the IsLoaded flag is reset to false indicating that the not all related entities are now loaded.

Applies to