简体   繁体   中英

C# & MongoDB.Driver - Why can't I find async methods as the documentation mentions?

I am currently working on a ASP.NET Web/API project and I migrate from SQL to MongoDB.

I currently follow that link:

https://www.codementor.io/pmbanugo/working-with-mongodb-in-net-1-basics-g4frivcvz

However, as I could read in the post above and on internet, there should be async methods but for some reason, I have nothing async available.

  • .NET 4.6.1
  • MongoDB.Bson v2.8.0
  • MongoDB.Driver v2.8.0
  • MongoDB.Driver.Core v2.8.0

Thanks for any help

add these two imports to your classes and see if the async extensions become available:

    using MongoDB.Driver;
    using MongoDB.Driver.Linq;

may i also suggest using MongoDB.Entities library instead of dealing with the c# driver directly. made my life so much easier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM