Azure-docs: client.OpenAsync no longer exists

Created on 14 Jan 2019  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

Tip #2 says "Call OpenAsync to avoid startup latency on first request". However, this method no longer exists on DocumentClient.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author cosmos-dsvc doc-bug triaged

All 9 comments

@mmulhearn Thank you for this detailed feedback. I am assigning this to the content owner (@SnehaGunda) to evaluate and update as appropriate.

@mmulhearn which version of the .Net SDK are you using? the OpenAsync method is available here is the reference doc: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.documentclient.openasync?view=azure-dotnet

@SnehaGunda I am using Microsoft.Azure.DocumentDB v1.22.0

I realized I wasn't using the latest so I updated to 2.2.1 and OpenAsync is also not found on DocumentClient in that version, either.

@mmulhearn thanks for clarifying, the doc uses DocumentClient where as the example in reference doc uses IDocumentClient interface to initialize the client object, can you check if this works?

using (IDocumentClient client = new DocumentClient(new Uri("service endpoint"), "auth key"))
{
await client.OpenAsync();
}

@SnehaGunda No, that does not work.

The issue seems to be a two-fold:

  1. IDocumentClient does not implement IDisposable, so that example code does not work
  2. OpenAsync() appears to be a method on DocumentClient, not IDocumentClient. I did find DocumentClient.OpenAsync(), but not IDocumentClient.OpenAsync().

@SnehaGunda Could you please provide update on the above issue?

@mmulhearn sorry about the long delay, we have verified that the 2.2.1, 2.2.2.. versions have OpenAsync() method. Yes it's a method on DocumentClient not IDoucmentClient. In the above example await client.OpenAsync();" client is a DocumentClient object and we are calling the method on it. If you find it in DocumentClient you are good.

If you don't have any further questions we will close this issue.

please-close

@SnehaGunda It looks like the documentation was updated. We can close this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behnam89 picture behnam89  Â·  3Comments

Ponant picture Ponant  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments