Vehicles dictionary updater

This commit is contained in:
Mikhail Shabanov committed 2020-06-07 14:39:03 +02:00
1 parent 6a9b69b254
commit 4a11ed61df
11 files changed
+525 -4

No files matched your search

@@ -14,6 +14,7 @@ namespace WotBlitzStatisticsPro.DataAccess
private const string ClanRolesCollectionName = "dictionary-clan-roles";
private const string AchievementsSectionsCollectionName = "dictionary-achievements-sections";
private const string AchievementsCollectionName = "dictionary-achievements";
private const string VehiclesCollectionName = "dictionary-vehicles";
private readonly IMongoDatabase _database;
@@ -72,5 +73,14 @@ namespace WotBlitzStatisticsPro.DataAccess
await dbAchievementSections.DeleteManyAsync(Builders<AchievementDictionary>.Filter.Empty);
await dbAchievementSections.InsertManyAsync(achievementDictionary);
}
public async Task UpdateVehicles(List<VehiclesDictionary> vehiclesDictionary)
{
var dbVehicles =
_database.GetCollection<VehiclesDictionary>(VehiclesCollectionName);
await dbVehicles.DeleteManyAsync(Builders<VehiclesDictionary>.Filter.Empty);
await dbVehicles.InsertManyAsync(vehiclesDictionary);
}
}
}