mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
Nullable refernce types refactoring
This commit is contained in:
1 parent
e5c90e03d3
commit
e12734981b
85 files changed
+509
-351
No files matched your search
@@ -1,4 +1,7 @@
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
|
||||
namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
||||
@@ -32,7 +35,8 @@ namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
||||
///<summary>
|
||||
/// Player's nick
|
||||
///</summary>
|
||||
public string Nickname { get; set; }
|
||||
[Required]
|
||||
public string Nickname { get; set; } = string.Empty;
|
||||
|
||||
///<summary>
|
||||
/// Player information update date
|
||||
|
||||
@@ -19,14 +19,14 @@ namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
||||
|
||||
public int LastBattleTime { get; set; }
|
||||
|
||||
public bool Equals(AccountInfoHistoryKey other)
|
||||
public bool Equals(AccountInfoHistoryKey? other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return AccountId == other.AccountId && LastBattleTime == other.LastBattleTime;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
||||
{
|
||||
public TankInfo()
|
||||
{
|
||||
|
||||
TankInfoId = new TankInfoKey();
|
||||
}
|
||||
|
||||
public TankInfo(long accountId, long tankId)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
||||
|
||||
public TankInfoHistory()
|
||||
{
|
||||
|
||||
TankInfoHistoryId = new TankInfoHistoryKey();
|
||||
}
|
||||
|
||||
public TankInfoHistory(long accountId, long tankId, int lastBattleTime)
|
||||
|
||||
@@ -31,14 +31,14 @@ namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
||||
///</summary>
|
||||
public int LastBattleTime { get; set; }
|
||||
|
||||
public bool Equals(TankInfoHistoryKey other)
|
||||
public bool Equals(TankInfoHistoryKey? other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return AccountId == other.AccountId && TankId == other.TankId && LastBattleTime == other.LastBattleTime;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
|
||||
@@ -25,14 +25,14 @@ namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
||||
///</summary>
|
||||
public long TankId { get; set; }
|
||||
|
||||
public bool Equals(TankInfoKey other)
|
||||
public bool Equals(TankInfoKey? other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return AccountId == other.AccountId && TankId == other.TankId;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
|
||||
Reference in new issue
Block a user