Adding the NuGet package

We need to add the MongoDB client API to our project. The best way to do this is by adding the NuGet package. We can do this as follows:

  1. Right-click on your project and select Manage NuGet Packages... from the context menu, as shown in the following screenshot:
  1. On the NuGet screen, select the Browse tab and enter Mongodb.Driver as the search term.
  2. Select the MongoDB.Driver by MongoDB option.
  1. Click on the Install button to add the latest stable package to your project. This is shown in the following screenshot:
  1. You can view the progress in the Output window of Visual Studio.
  1. After MongoDB has been added to ...

Get C# 8 and .NET Core 3 Projects Using Azure - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.