public ChestDropRepository(ISkinsStatisticsDatabaseSettings settings) { var client = new MongoClient(settings.ConnectionString); var database = client.GetDatabase(settings.DatabaseName); _chestDrops = database.GetCollection <ChestDrop>(settings.ChestDropsCollectionName); }
public UserRepository(ISkinsStatisticsDatabaseSettings settings) { var client = new MongoClient(settings.ConnectionString); var database = client.GetDatabase(settings.DatabaseName); _chestDrops = database.GetCollection <User>(settings.UserCollectionName); var key = Builders <User> .IndexKeys.Ascending(x => x.Login); _chestDrops.Indexes.CreateOne(new CreateIndexModel <User>(key)); }