Skip to content

Commit

Permalink
Documentation: Fixes ReadManyItemsStreamAsync example (#3034)
Browse files Browse the repository at this point in the history
Updated ReadManyItemsStreamAsync example code snippet with proper working code.
  • Loading branch information
SaurabhSharma-MSFT committed Feb 16, 2022
1 parent c578e89 commit a6b06e3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -639,16 +639,20 @@ public abstract Task<ItemResponse<T>> ReplaceItemAsync<T>(
/// ("Id3", new PartitionKey("pkValue3"))
/// };
///
/// using (ResponseMessage responseMessage = await this.Container.ReadManyItemsStreamAsync(itemList))
/// using (ResponseMessage response = await this.Container.ReadManyItemsStreamAsync(itemList))
/// {
/// using (Stream stream = response.ReadBodyAsync())
/// if (!response.IsSuccessStatusCode)
/// {
/// //Read or do other operations with the stream
/// using (StreamReader streamReader = new StreamReader(stream))
/// {
/// string content = streamReader.ReadToEndAsync();
/// }
/// //Handle and log exception
/// return;
/// }
///
/// //Read or do other operations with the stream
/// using (StreamReader streamReader = new StreamReader(response.Content))
/// {
/// string content = streamReader.ReadToEndAsync();
/// }
///
/// }
/// ]]>
/// </code>
Expand Down

0 comments on commit a6b06e3

Please sign in to comment.