AchievementDictionaries saving done

This commit is contained in:
Mikhail Shabanov committed 2020-06-06 15:54:23 +02:00
1 parent cacc60fc7f
commit 6a9b69b254
11 files changed
+613 -3

No files matched your search

@@ -13,6 +13,7 @@ namespace WotBlitzStatisticsPro.DataAccess
private const string VehicleTypesCollectionName = "dictionary-vehicle-types";
private const string ClanRolesCollectionName = "dictionary-clan-roles";
private const string AchievementsSectionsCollectionName = "dictionary-achievements-sections";
private const string AchievementsCollectionName = "dictionary-achievements";
private readonly IMongoDatabase _database;
@@ -62,5 +63,14 @@ namespace WotBlitzStatisticsPro.DataAccess
await dbAchievementSections.DeleteManyAsync(Builders<AchievementSectionDictionary>.Filter.Empty);
await dbAchievementSections.InsertManyAsync(achievementSections);
}
public async Task UpdateAchievements(List<AchievementDictionary> achievementDictionary)
{
var dbAchievementSections =
_database.GetCollection<AchievementDictionary>(AchievementsCollectionName);
await dbAchievementSections.DeleteManyAsync(Builders<AchievementDictionary>.Filter.Empty);
await dbAchievementSections.InsertManyAsync(achievementDictionary);
}
}
}
@@ -15,5 +15,7 @@ namespace WotBlitzStatisticsPro.DataAccess
Task UpdateClanRoles(List<ClanRoleDictionary> clanRoles);
Task UpdateAchievementsSections(List<AchievementSectionDictionary> achievementSections);
Task UpdateAchievements(List<AchievementDictionary> achievementDictionary);
}
}