feat: clan query implemented

This commit is contained in:
Mikhail Shabanov committed 2021-03-22 14:58:13 +01:00
1 parent 8fb1b170df
commit af747cf3f4
7 files changed
+97 -8

No files matched your search

@@ -139,5 +139,19 @@ namespace WotBlitzStatisticsPro.DataAccess
return collection.ToDictionary(n => n.typeId, n => n.typeValue);
}
public async Task<Dictionary<string, string>> GetClanRoles(RequestLanguage language)
{
var collection = await _database.GetCollection<ClanRoleDictionary>(ClanRolesCollectionName)
.Find(Builders<ClanRoleDictionary>.Filter.Empty)
.Project(n => new
{
ClanRoleId = n.ClanRoleId,
ClanRoleValueValue = n.ClanRoleNames.First(v => v.Language == language).Value
})
.ToListAsync();
return collection.ToDictionary(n => n.ClanRoleId, n => n.ClanRoleValueValue);
}
}
}