First attempt at accessing Cosmos db.
All this is in a DAL project layer of the solution (n-tier). EndPointURI and PrimaryKey and DBName are setup by the class constructor.
I execute the client.CreateDocumentQuery
But not seeing the expected cast to the out param of the function i.e. "user". I see the generated query string only.
If trying ReadDocumentAsync, I get the following
CodePudding user response:
Try this, you need to return the first item
var response = this.client.CreateDocumentQuery<eUser>( UriFactory.CreateDocumentCollectionUri("demo", "Users"), queryOptions)
.Where(f => f.Email == email).AsEnumerable().ToArray().FirstOrDefault();