From 852fbf5ae8c901d691d807d7d671803ca68747f5 Mon Sep 17 00:00:00 2001 From: Glax Date: Sun, 18 May 2025 14:05:03 +0200 Subject: [PATCH] Chapter.cs Compare Ids for Collection-Comparisons --- API/Schema/Chapter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/API/Schema/Chapter.cs b/API/Schema/Chapter.cs index 695b826..ba8d36e 100644 --- a/API/Schema/Chapter.cs +++ b/API/Schema/Chapter.cs @@ -60,6 +60,9 @@ public class Chapter : IComparable { if (other is not { } otherChapter) throw new ArgumentException($"{other} can not be compared to {this}"); + //Compare Ids for Collection-Comparisons + if(other.ChapterId.Equals(this.ChapterId)) + return 0; return VolumeNumber?.CompareTo(otherChapter.VolumeNumber) switch { < 0 => -1,