mongodb

A 2-post collection

Using ASP.NET Core with MongoDB in containers for local dev, CosmosDB for production

If nothing else is true, containers have made local development on a platform so much easier. If you want to use SQL Server for your backend just docker pull microsoft/mssql-server-linux and you can start up an instance with a few parameters. Azure CosmosDB is not available as a container, however, MongoDB is available and happens to be a database I have used in previous applications. MongoDB is one of the many APIs that CosmosDB supports; locally I can develop against an instance of Mongo either in a container or installed and simply change the connection string for my production instance. The flexibility of being able to use MongoDB and then just changing a connection string to use CosmosDB is...


Building Web API using MVC 6 & MongoDB

This is a quick walkthrough on using ASP.NET 5 to build a Web API layer using MongoDB. The overall concept is not too dissimilar from previous examples you may have seen using X type of database, however there are some areas covered that are either new in MVC 6 that you may find you didn't know are there. Topics Covered ConfigurationModel config.json Environment Variables OptionsModel Dependency Injection (IServiceCollection) Forcing JSON or Removing XML Formatter, Content Negotiation MongoDB Installation (OSX & Windows) mongocsharpdriver (nuget package) Testing endpoints w/ Postman or Fiddler Project Creation Depending on your environment (Windows or OS X) or preference you have a choice on how you can create the ASP.NET project. Visual Studio 2015...