Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,23 @@ public async Task<QueryRowResponse> GetNextRow(ContentAs? rowContentAs = null)
}
}

var effectiveContentAs = rowContentAs ?? ContentAs
?? throw new InvalidOperationException("No ContentAs available for row deserialization.");
var effectiveContentAs = rowContentAs ?? ContentAs;

QueryRowResponse response;

if (await _cachedEnumerator!.MoveNextAsync().ConfigureAwait(false))
{
var row = new QueryRowResponse.Types.Row();
// QueryRowResponse.Row is optional and only present if the driver sent ContentAs in the request
if (effectiveContentAs is not null)
{
row.RowContent = _cachedEnumerator.Current.ContentAsToAnalyticsRow(effectiveContentAs);
}
response = new QueryRowResponse()
{
Success = new QueryRowResponse.Types.Result()
{
Row = new QueryRowResponse.Types.Row()
{
RowContent = _cachedEnumerator.Current.ContentAsToAnalyticsRow(effectiveContentAs)
}
Row = row
}
};
}
Expand All @@ -95,4 +97,4 @@ public async Task<QueryRowResponse> GetNextRow(ContentAs? rowContentAs = null)

return response;
}
}
}
Loading