Mendz.Data and Mendz.Data.MongoDB

Now it's time to get organized. The way I did it, Mendz.Data is a separate project from Mendz.Data.MongoDB. By default, using Mendz.Data makes the project ADO.Net ready. Adding a reference to Mendz.Data.MongoDB makes the project also MongoDB ready.

The following image shows how the Mendz.Data and Mendz.Data.MongoDB projects are organized.



Note that Mendz.Data.MongoDB references MongoDB's driver for .Net.

Mendz.Data should compile to its own DLL.

Mendz.Data.MongoDB should also compile to its own DLL.

When creating a MongoDB data context instance, the project must reference both Mendz.Data and Mendz.Data.MongoDB.

When creating a MongoDB targeting "repository", the project must reference both Mendz.Data and Mendz.Data.MongoDB.

If you want to learn more about Mendz.Data, read my Preparing for Dapper and Working with Dapper series, both of which are linked here. Have fun!

Comments