This commit is contained in:
ai.astrakhantsev 2023-02-22 09:00:47 +05:00
parent f62b23fc47
commit 594033b3bc
2 changed files with 16 additions and 6 deletions

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Nullable>disable</Nullable>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

View File

@ -9,7 +9,7 @@ namespace AsbCloudApp.Comparators
/// </summary>
public class ComparerIId : IComparer<IId>, IEqualityComparer<IId>
{
private static readonly ComparerIId instance = new ();
private static readonly ComparerIId instance = new();
private ComparerIId() { }
/// <summary>
@ -24,8 +24,13 @@ namespace AsbCloudApp.Comparators
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
public int Compare(IId x, IId y) =>
x.Id.CompareTo(y.Id);
public int Compare(IId? x, IId? y)
{
if (x is null || y is null)
return 0;
else
return x.Id.CompareTo(y.Id);
}
/// <summary>
///
@ -33,8 +38,13 @@ namespace AsbCloudApp.Comparators
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
public bool Equals(IId x, IId y) =>
x.Id == y.Id;
public bool Equals(IId? x, IId? y)
{
if (x is null || y is null)
return false;
else
return x.Id == y.Id;
}
/// <summary>
///