From 976cd036236d334d916cf52c37ca2fd7cc306a6d Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 27 Feb 2024 22:20:03 +0100 Subject: [PATCH] Equals override --- JobQueue/Job.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JobQueue/Job.cs b/JobQueue/Job.cs index 9fd14ce..ca90df7 100644 --- a/JobQueue/Job.cs +++ b/JobQueue/Job.cs @@ -79,4 +79,9 @@ public abstract class Job : IComparable throw new ArgumentException("Type can not be compared", nameof(obj)); return TimeToNextExecution().CompareTo(other.TimeToNextExecution()); } + + public override bool Equals(object? obj) + { + return obj is Job other && other.JobId.Equals(this.JobId); + } } \ No newline at end of file