Skip to content

Commit

Permalink
It may be possible to wait for all entities to be loaded #696
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Apr 23, 2022
1 parent 70fd47d commit b5f4ed9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion FetchXmlBuilder/FetchXmlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1276,8 +1276,12 @@ private void LoadEntities(ConnectionDetail connectionDetail)
{ // Already cached
eventargs.Result = connectionDetail.MetadataCache;
}
else if (settings.WaitUntilMetadataLoaded)
{ // Load the cache until done
eventargs.Result = connectionDetail.MetadataCacheLoader.ConfigureAwait(false).GetAwaiter().GetResult()?.EntityMetadata;
}
else
{ // Load to cache
{ // Load the cache in background
connectionDetail.MetadataCacheLoader.ContinueWith(task =>
{ // Waiting for loaded
SetAfterEntitiesLoaded(task.Result?.EntityMetadata);
Expand Down

0 comments on commit b5f4ed9

Please sign in to comment.