title: MongoDB Official C# Driver in ASP.NET MVC app with Ninject dependency injection
body: <p>Does anyone have a code example that follows best practices of using MongoDB Official C# Driver with Ninject in ASP.NET MVC app?</p>
  
  <p>Mine looks like this:</p>
  
  <pre><code>namespace WebApp
  {
      public class DataModule : NinjectModule
      {
          public override void Load()
          {
              var conventions = new ConventionProfile().SetElementNameConvention(new CamelCaseElementNameConvention());
              BsonClassMap.RegisterConventions(conventions, x =&gt; true);
  
              var server = MongoServer.Create(connectionString);
              var database = server.GetDatabase("webapp");
              Bind&lt;MongoDatabase&gt;().ToConstant(database);
          }
      }
  }
  </code></pre>
  
  <p>Since this code is singleton, I have a bad feeling about it :|</p>
  
  <p>Thanks</p>