Skip to content

Instantly share code, notes, and snippets.

@zivillian
Created August 24, 2016 14:48
Show Gist options
  • Select an option

  • Save zivillian/29fa3d25012def9e0f14edde02f75124 to your computer and use it in GitHub Desktop.

Select an option

Save zivillian/29fa3d25012def9e0f14edde02f75124 to your computer and use it in GitHub Desktop.
Simple.OData.Client.Core/ODataClient.Internals.cs | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/Simple.OData.Client.Core/ODataClient.Internals.cs b/Simple.OData.Client.Core/ODataClient.Internals.cs
index c79e0ac..53431d4 100644
--- a/Simple.OData.Client.Core/ODataClient.Internals.cs
+++ b/Simple.OData.Client.Core/ODataClient.Internals.cs
@@ -23,13 +23,16 @@ namespace Simple.OData.Client
var result = await ExecuteRequestWithResultAsync(request, cancellationToken,
x => x.AsEntry(_session.Settings.IncludeAnnotationsInResults), () => null, () => request.EntryData).ConfigureAwait(false);
- if (cancellationToken.IsCancellationRequested) cancellationToken.ThrowIfCancellationRequested();
+ if (cancellationToken.IsCancellationRequested) cancellationToken.ThrowIfCancellationRequested();
- var keyNames = _session.Metadata.GetDeclaredKeyPropertyNames(commandText);
- if (result == null && resultRequired && Utils.AllMatch(keyNames, entryData.Keys, _session.Pluralizer))
- {
- result = await this.GetEntryAsync(commandText, entryData, cancellationToken).ConfigureAwait(false);
- if (cancellationToken.IsCancellationRequested) cancellationToken.ThrowIfCancellationRequested();
+ if (result == null && resultRequired)
+ {
+ var keyNames = _session.Metadata.GetDeclaredKeyPropertyNames(commandText);
+ if (Utils.AllMatch(keyNames, entryData.Keys, _session.Pluralizer))
+ {
+ result = await this.GetEntryAsync(commandText, entryData, cancellationToken).ConfigureAwait(false);
+ if (cancellationToken.IsCancellationRequested) cancellationToken.ThrowIfCancellationRequested();
+ }
}
return result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment