Beispiel #1
0
        public void Configuration(IAppBuilder app)
        {
            DependencyInjectionConfiguration.Bootstrap(typeof(MvcApplication).Assembly);
            MongoModelMapper.Activate();

            ConfigureAuth(app);
            app.MapSignalR();
            Bootstrapper.Bootstrap();
            GlobalHost.HubPipeline.RequireAuthentication();
        }
        /// <summary>
        /// Get database reference by providing database name
        /// </summary>
        /// <param name="DbName">Database Name</param>
        /// <returns></returns>
        private IMongoDatabase GetMongoDatabase(string DbName)
        {
            // config models mapping with mongo serializer
            MongoModelMapper.Map();

            if (Client != null)
            {
                return(Client.GetDatabase(DbName, new MongoDatabaseSettings {
                    ReadEncoding = new UTF8Encoding(), WriteEncoding = new UTF8Encoding()
                }));
            }
            return(null);
        }