mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-22 06:03:01 +02:00
Chapter.cs Compare Ids for Collection-Comparisons
This commit is contained in:
parent
4e7a725fee
commit
852fbf5ae8
@ -60,6 +60,9 @@ public class Chapter : IComparable<Chapter>
|
|||||||
{
|
{
|
||||||
if (other is not { } otherChapter)
|
if (other is not { } otherChapter)
|
||||||
throw new ArgumentException($"{other} can not be compared to {this}");
|
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
|
return VolumeNumber?.CompareTo(otherChapter.VolumeNumber) switch
|
||||||
{
|
{
|
||||||
< 0 => -1,
|
< 0 => -1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user