--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/9b8d9978-1ebd-4c74-8885-4ae592beacc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Your code looks correct.One possibility is that you are experiencing an async deadlock. Read up on ConfigureAwait(false) and try changing your await calls to:await collection.FindAsync(filter).ConfigureAwait(false)await cursor.MoveNextAsync().ConfigureAwait(false)
On Sun, Oct 22, 2017 at 3:10 AM, Prashant Maurya <er.maury...@gmail.com> wrote:
I have tried my level best to access my db using the methods specified in the mongoDb official.using (var cursor = await collection.FindAsync(filter)){while (await cursor.MoveNextAsync()){var batch = cursor.Current;foreach (var document in batch){user.Add(new{UserId = document["_id"].ToString(),FName = document["FName"].ToString(),LName = document["LName"].ToString(),ActiveStatus = document["ActiveStatus"].ToBoolean()});}}}But the line var cursor=await collection.FindAsync(filter) is not executing.Interesting part is the same piece of code working in console application. The application which i am working currently is MVC Application using .Net Framework.Please tell me the solution to solve the above mentioned query.I have posted the same question on stackoverflow also.
--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-dev/b425255e-8113-4c6e-89df-18d2e93c49da%40googlegroups.com.