Saving accounts To DB

This commit is contained in:
Mikhail Shabanov committed 2020-11-06 19:23:20 +01:00
1 parent 31b067e087
commit ddbf42e7bb
14 files changed
+372 -54

No files matched your search

@@ -1,16 +1,28 @@
namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
using MongoDB.Bson.Serialization.Attributes;
namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
{
public class AccountInfoHistory
{
public AccountInfoHistory(long accountId, int lastBattleTime)
{
AccountInfoHistoryId = new AccountInfoHistoryKey(accountId, lastBattleTime);
}
[BsonId]
public AccountInfoHistoryKey AccountInfoHistoryId { get; set; }
///<summary>
/// Player account identifier
///</summary>
public long AccountId { get; set; }
[BsonIgnore]
public long AccountId => AccountInfoHistoryId.AccountId;
///<summary>
/// Last battle time
///</summary>
public int LastBattleTime { get; set; }
[BsonIgnore]
public int LastBattleTime => AccountInfoHistoryId.LastBattleTime;
///<summary>
/// Battles count