Esempio n. 1
0
        private static void CreateCollections(IMongoDbContext dbContext)
        {
            var collections = dbContext.ListCollections();

            if (!collections.Has <Post>())
            {
                dbContext.CreateCollection <Post>();
            }

            if (!collections.Has <User>())
            {
                dbContext.CreateCollection <User>();
            }

            if (!collections.Has <Taxonomy>(name: "taxonomies"))
            {
                dbContext.CreateCollection <Taxonomy>();
            }
        }