From cf72623dbc9b7714ce3dccbd14d5839bad80912e Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sun, 5 Jan 2025 17:07:38 -0500 Subject: [PATCH] add DuplicateKeyException --- .../Collections/DuplicateKeyException.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 framework-dotnet/src/lib/MBS.Core/Collections/DuplicateKeyException.cs diff --git a/framework-dotnet/src/lib/MBS.Core/Collections/DuplicateKeyException.cs b/framework-dotnet/src/lib/MBS.Core/Collections/DuplicateKeyException.cs new file mode 100644 index 0000000..7b2ab6b --- /dev/null +++ b/framework-dotnet/src/lib/MBS.Core/Collections/DuplicateKeyException.cs @@ -0,0 +1,24 @@ +using System; + +namespace MBS.Core.Collections; + + +/// +/// The exception thrown when an item with the same key has already been added. +/// +public class DuplicateKeyException : ArgumentException +{ + + public DuplicateKeyException() : base("An item with the same key has already been added.") + { + } + public DuplicateKeyException(Exception? innerException) : base("An item with the same key has already been added.", innerException) + { + } + + public DuplicateKeyException(string? message) : base(message) { } + public DuplicateKeyException(string? message, Exception? innerException) : base(message, innerException) { } + public DuplicateKeyException(string? message, string? paramName) : base(message, paramName) { } + public DuplicateKeyException(string? message, string? paramName, Exception? innerException) : base(message, paramName, innerException) { } + +}