Example #1
0
        private static void SeedComparableFields(IMongoDatabase database, string collectionname)
        {
            var comparablefields            = DataSeed.Seed <List <ComparableFields> >(@"./seedData/comparablefields.json");
            var comparablefields_collection = database.GetCollection <ComparableFields>(collectionname);

            foreach (var field in comparablefields)
            {
                Console.WriteLine(field.FieldName);
                comparablefields_collection.InsertOne(field);
                Thread.Sleep(100);
            }
        }
Example #2
0
        private static void SeedCountries(IMongoDatabase database, string collectionname)
        {
            var countries            = DataSeed.Seed <List <Country> >(@"./seedData/countrieslist.json");
            var countries_collection = database.GetCollection <Country>(collectionname);

            foreach (var country in countries)
            {
                Console.WriteLine(country.Name);
                countries_collection.InsertOne(country);
                Thread.Sleep(100);
            }
        }
Example #3
0
        private static void SeedNotesandDefs(IMongoDatabase database, string collectionname)
        {
            var notesanddefs            = DataSeed.Seed <Dictionary <string, string> >(@"./seedData/notesanddefs.json");
            var notesanddefs_collection = database.GetCollection <NotesAndDefs>(collectionname);

            foreach (KeyValuePair <string, string> kvp in notesanddefs)
            {
                notesanddefs_collection.InsertOne(new NotesAndDefs()
                {
                    FieldName  = kvp.Key,
                    Definition = kvp.Value
                });
                Console.WriteLine(kvp.Key);
            }
        }
Example #4
0
        private static void SeedCountryDetails(IMongoDatabase database, string collectionname)
        {
            var countrydetails            = DataSeed.Seed <Dictionary <string, List <ProfileEntity> > >(@"./seedData/countrydetails.json");
            var countrydetails_collection = database.GetCollection <CountryEntity>(collectionname);

            foreach (KeyValuePair <string, List <ProfileEntity> > kvp in countrydetails)
            {
                Console.WriteLine($"Inserting {kvp.Key}");
                countrydetails_collection.InsertOne(new CountryEntity()
                {
                    CountryCode = kvp.Key,
                    CountryData = kvp.Value
                });
                Thread.Sleep(250);
            }
        }