I actually started the night trying to learn more about MongoDB, but am getting hung up and the .NET await/async stuff. I am trying to implement the code shown on MongoDB\'s
I' not so good with async dev and had a similar problem, however I was kicking off the async method in Main
like:
Task.Run(async () => await GetDataAsync());
I think the Garbage Collector was disposing of the anonymous method as nothing had a reference to it anymore. Using Fabien's .Wait()
allowed me to step through the program and debug. I am using netcore 2.1 with vs2017