🔧 Disable nullable reference types in the Data project

pull/110/head
Alexis Drai 2 years ago
parent 1604fece2f
commit 9a453da7bc

@ -3,7 +3,6 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<StartWorkingDirectory>$(MSBuildProjectDirectory)</StartWorkingDirectory> <StartWorkingDirectory>$(MSBuildProjectDirectory)</StartWorkingDirectory>
</PropertyGroup> </PropertyGroup>

@ -7,9 +7,9 @@ namespace Data.EF.Players
{ {
public Guid ID { get; set; } public Guid ID { get; set; }
public string? Name { get; set; } public string Name { get; set; }
public override bool Equals(object? obj) public override bool Equals(object obj)
{ {
if (obj is not PlayerEntity) if (obj is not PlayerEntity)
{ {
@ -18,9 +18,9 @@ namespace Data.EF.Players
return Equals(obj as PlayerEntity); return Equals(obj as PlayerEntity);
} }
public bool Equals(PlayerEntity? other) public bool Equals(PlayerEntity other)
{ {
return other is not null && this.ID == other!.ID && this.Name == other.Name; return other is not null && this.ID == other.ID && this.Name == other.Name;
} }
public override int GetHashCode() public override int GetHashCode()
@ -28,7 +28,7 @@ namespace Data.EF.Players
return HashCode.Combine(ID, Name); return HashCode.Combine(ID, Name);
} }
public override string? ToString() public override string ToString()
{ {
return $"{ID.ToString().ToUpper()} -- {Name}"; return $"{ID.ToString().ToUpper()} -- {Name}";
} }

Loading…
Cancel
Save