From 5f835a1f99b557a21bfa46c9582746768bcd2db8 Mon Sep 17 00:00:00 2001 From: erosxdev <105377128+erosxdev@users.noreply.github.com> Date: Fri, 13 May 2022 07:34:50 +0200 Subject: [PATCH] Annotations are not downloaded if they are not needed --- src/Simple.OData.Client.Core/ODataClient.Internals.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simple.OData.Client.Core/ODataClient.Internals.cs b/src/Simple.OData.Client.Core/ODataClient.Internals.cs index f6a6e932..aca4addf 100644 --- a/src/Simple.OData.Client.Core/ODataClient.Internals.cs +++ b/src/Simple.OData.Client.Core/ODataClient.Internals.cs @@ -344,7 +344,7 @@ private async Task EnrichWithMediaPropertiesAsync(AnnotatedEntry entry, IEnumera { var entityMediaPropertyName = mediaProperties.FirstOrDefault(x => !entry.Data.ContainsKey(x)); entityMediaPropertyName ??= FluentCommand.AnnotationsLiteral; - if (entry.Annotations != null) + if (Session.Settings.IncludeAnnotationsInResults && entry.Annotations != null) { await GetMediaStreamValueAsync(entry.Data, entityMediaPropertyName, entry.Annotations.MediaResource, cancellationToken).ConfigureAwait(false); }