var response = await client.GetResponseAsync(request); var context = new JsonUnmarshallerContext(response.ResponseStream, false); // Test if the response document contains a specific item if (context.TestExpression("Items[0] != null", false)) { // Retrieve the first item from the response var item = AmazonS3Util.GetObject- (context.CurrentUnmarshallerContext, "Items[0]"); }
var response = await client.GetResponseAsync(request); var context = new JsonUnmarshallerContext(response.ResponseStream, false); var items = new ListOverall, the JsonUnmarshallerContext TestExpression is a useful tool for developers who need to evaluate and filter JSON data during the unmarshalling process. It is part of the Amazon.Runtime.Internal.Transform package library for C#.- (); while (context.Read()) { // Use a TestExpression to filter out items that do not meet certain criteria if (context.TestExpression("Items[?(@.IsAvailable == true)]", false)) { var item = AmazonS3Util.GetObject
- (context.CurrentUnmarshallerContext, ""); items.Add(item); } }