Beispiel #1
0
        public static void Run()
        {
            Logger.Info("About to start initial load");

            var db = new MongoDb();

            MongoDb.Instance.DropCollection("expenditures");
            // ResetCategories(db);
            Logger.Info("Initial load completed successfully");
        }
Beispiel #2
0
        private static void ResetCategories(MongoDb db)
        {
            MongoDb.Instance.DropCollection("categories");
            var categoryNames = new[] { "życie", "rachunki", "lekarze", "dziecko", "rozpusta", "rtv", "remonty" };

            db.Categories.InsertMany(categoryNames.Select(x => new Category {
                Name = x, Id = Guid.NewGuid()
            }));
            ;
        }
Beispiel #3
0
 public ServerRepo(MongoDb mongoDb)
 {
     _mongoDb = mongoDb;
 }