Skip to content

Conversation

@AlexanderSher
Copy link
Contributor

No description provided.

{
var uri = new Uri(TestEnvironment.ReceiptUri);
operation = await client.StartRecognizeReceiptsFromUriAsync(uri, default);
receipts = (await client.RecognizeReceiptsFromUriAsync(uri, default)).Value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not wild about the need to put parentheses around the expression and have .Value at the end.

Is there another approach? Krzysztof was ok with this approach...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implicit conversion to interfaces isn't allowed. Since RecognizeReceiptsOperation uses interface as its value type:

RecognizeReceiptsOperation : Operation<IReadOnlyList<RecognizedReceipt>>

we have to either return IReadOnlyList<RecognizedReceipt> from extension method instead of Response<IReadOnlyList<RecognizedReceipt>> or change value type to ReadOnlyCollection or some other concrete type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When writing TA samples, Krzysztof raised this concern too, and after looking at alternatives, we went with .Value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants