mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-24 03:40:07 +02:00
Account db read operation
This commit is contained in:
1 parent
91f69a6e39
commit
1c803585e1
7 files changed
+61
-5
No files matched your search
@@ -1,7 +1,10 @@
|
||||
namespace WotBlitzStatisticsPro.DataAccess
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.DataAccess.Model.Accounts;
|
||||
|
||||
namespace WotBlitzStatisticsPro.DataAccess
|
||||
{
|
||||
public interface IWargamingAccountDataAccessor
|
||||
{
|
||||
|
||||
Task<AccountInfo> ReadAccountInfo(long accountId);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using MongoDB.Driver;
|
||||
using System.Threading.Tasks;
|
||||
using MongoDB.Driver;
|
||||
using WotBlitzStatisticsPro.Common;
|
||||
using WotBlitzStatisticsPro.DataAccess.Model.Accounts;
|
||||
|
||||
@@ -63,6 +64,11 @@ namespace WotBlitzStatisticsPro.DataAccess
|
||||
.CreateOne(tankInfoHistoryIndexModel);
|
||||
}
|
||||
|
||||
// ToDo: Read account
|
||||
public async Task<AccountInfo> ReadAccountInfo(long accountId)
|
||||
{
|
||||
var account = await _database.GetCollection<AccountInfo>(AccountInfoCollectionName)
|
||||
.FindAsync(Builders<AccountInfo>.Filter.Where(a => a.AccountId == accountId));
|
||||
return account.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user