Prerequisites
Prerequisites
To build and run this project, you will need Visual Studio 2019 Community Edition for MacOS or Windows, which you can download here: VS Community 2019 Downloads.
It is also helpful, but not necessary, to have a working installation of Git version control.
1. Download the Repository
To get started with this sample project, download this repository to your programming environment. You can close this project using Git version control:
git clone git@github.com:mongodb-university/atlas_starter_dotnet.git
Or you can download the ZIP archive using your browser. If you download this project as a ZIP archive, unzip the archive before proceeding.
2. Open the Project
In Visual Studio, select
File > Open...
Navigate to the directory containing this project, and then the AtlasStarter folder.
Select the AtlasStarter.sln file, and then click
OK
.
3. Configure your Atlas Credentials
Open the
Program.cs
file.On line 17, replace the placeholder text with the connection string to your Atlas cluster.
var mongoUri = "<Your Atlas Connection String>";
4. Run the Project
Click the Run icon, or from the Run menu, choose Start Debugging.
Assuming you have the correct connection string, you have now connected the C# app to your MongoDB Atlas datastore. Have fun modifying the code to experiment with the C# driver and MongoDB.
โ