forked from ddrilling/AsbCloudServer
This commit is contained in:
parent
f62b23fc47
commit
594033b3bc
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<Nullable>disable</Nullable>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -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>
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user