Example #1
0
        public EngineCensoContext(MongoConfig config)
        {
            var client = new MongoClient(config.ConnectionString);

            if (client != null)
            {
                mongoDatabase = client.GetDatabase(config.Database);
            }
        }
        public async Task Seed(MongoConfig config)
        {
            EngineCensoContext context = new EngineCensoContext(config);

            if (!context.CensoMappings.Find(x => true).Any())
            {
                await ConfigureIndexes(context.CensoMappings);

                await context.CensoMappings.InsertManyAsync(SeedData);
            }
        }
 public CensoMappingMongoRepository(MongoConfig config)
 {
     context = new EngineCensoContext(config);
 }