Прочетете на английски Редактиране

Споделяне чрез


RelatedEnd.IsLoaded Property

Definition

Gets a value that indicates whether all related objects have been loaded.

C#
public bool IsLoaded { get; }

Property Value

true if the related end contains all the related objects from the database; otherwise, false.

Implements

Remarks

Calling the Load method sets the IsLoaded flag to true.

Calling the Clear method on an EntityCollection<TEntity> sets IsLoaded to false.

An EntityCollection<TEntity> or EntityReference<TEntity> may also be loaded if the related end is included in the query path. For more information about span, see Loading Related Objects.

The Load method on EntityCollection<TEntity> and EntityReference<TEntity> loads related objects from the data source whether or not IsLoaded is true.

When an object is detached, the IsLoaded flag is changed from false to true.

To guarantee that a related end is fully loaded before doing processing, you should check whether IsLoaded is false. If IsLoaded is false, you should call the Load method.

Applies to

Продукт Версии
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1