Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #49 from rhalaly/improvement
Browse files Browse the repository at this point in the history
Make `SetFeedOptionsForSingleOperation` shorter and more readable
  • Loading branch information
Elfocrash committed Jan 5, 2019
2 parents fbef306 + c00054d commit 876780c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Cosmonaut/Extensions/CosmosResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,8 @@ public static class CosmosResultExtensions

private static void SetFeedOptionsForSingleOperation<T>(ref IQueryable<T> queryable, out FeedOptions feedOptions)
{
feedOptions = queryable.GetFeedOptionsForQueryable();
if (feedOptions != null)
{
feedOptions.MaxItemCount = 1;
queryable.SetFeedOptionsForQueryable(feedOptions);
return;
}

feedOptions = new FeedOptions {MaxItemCount = 1};
feedOptions = queryable.GetFeedOptionsForQueryable() ?? new FeedOptions();
feedOptions.MaxItemCount = 1;
queryable.SetFeedOptionsForQueryable(feedOptions);
}

Expand Down

0 comments on commit 876780c

Please sign in to comment.