• Stars
    star
    184
  • Rank 209,187 (Top 5 %)
  • Language
    C#
  • Created about 8 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Using MongoDB with ASP.NET Web API and ASP.NET Core to perform CRUD operations and build a NotebookApp

Example: Using MongoDB .NET Driver with .NET Core WebAPI

Walkthrough blog post - http://qappdesign.com/using-mongodb-with-net-core-webapi

This is the first blog post, presenting the backend associated with a sample application: NotebookApp.

It is a quick walkthrough on using .NET Core 2 to build a Web API layer using MongoDB .NET Driver version 2. All the calls to the database are asynchronous.

Topics Covered

  • Technology stack
  • Configuration model
  • Options model
  • Dependency injection
  • MongoDb – Installation and configuration using MongoDB C# Driver v.2
  • Make a full ASP.NET WebApi project, connected async to MongoDB
  • Allowing Cross Domain Calls (CORS)
  • Update entire MongoDB documents
  • Exception management

How to run it

  • Download or clone this project locally
  • Install the tools - see here more details: http://qappdesign.com/using-mongodb-with-net-core-webapi
  • Run first the MongoDB server (details in the article)
  • Then in the console, within the current project folder, run the next two commands: dotnet restore, and then dotnet run
  • The ASP.NET Core WebAPI will run using IIS (default settings: http://localhost:5000)