From bf06b316568bb88ed5f69a0adff4f46d2004f4bc Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 27 Jul 2026 15:40:52 +0200 Subject: [PATCH] Support multi-targeting and reformat exception classes Updated the project file to support multi-targeting for both .NET Framework 4.6.2 and .NET 8.0 by replacing `` with ``. Reformatted `AuthenticationFailedException` and `NotFoundException` classes to use braces `{ }` for namespaces and constructors for consistency. No functional changes were made to the exception classes. --- ...DigitalData.MessagingService.Domain.csproj | 2 +- .../AuthenticationFailedException.cs | 25 +++++++------- .../Exceptions/NotFoundException.cs | 33 +++++++++---------- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/DigitalData.MessagingService.Domain/DigitalData.MessagingService.Domain.csproj b/src/DigitalData.MessagingService.Domain/DigitalData.MessagingService.Domain.csproj index 13604a5..aae1656 100644 --- a/src/DigitalData.MessagingService.Domain/DigitalData.MessagingService.Domain.csproj +++ b/src/DigitalData.MessagingService.Domain/DigitalData.MessagingService.Domain.csproj @@ -1,7 +1,7 @@  - net8.0 + net462;net8.0 enable enable diff --git a/src/DigitalData.MessagingService.Domain/Exceptions/AuthenticationFailedException.cs b/src/DigitalData.MessagingService.Domain/Exceptions/AuthenticationFailedException.cs index 1111102..6e41e7a 100644 --- a/src/DigitalData.MessagingService.Domain/Exceptions/AuthenticationFailedException.cs +++ b/src/DigitalData.MessagingService.Domain/Exceptions/AuthenticationFailedException.cs @@ -1,17 +1,16 @@ -namespace DigitalData.MessagingService.Domain.Exceptions; - -/// -/// Exception thrown when OAuth2 authentication fails. -/// -public class AuthenticationFailedException : Exception +namespace DigitalData.MessagingService.Domain.Exceptions { - public AuthenticationFailedException(string message) - : base(message) + /// + /// Exception thrown when OAuth2 authentication fails. + /// + public class AuthenticationFailedException : Exception { - } + public AuthenticationFailedException(string message) : base(message) + { + } - public AuthenticationFailedException(string message, Exception innerException) - : base(message, innerException) - { + public AuthenticationFailedException(string message, Exception innerException) : base(message, innerException) + { + } } -} +} \ No newline at end of file diff --git a/src/DigitalData.MessagingService.Domain/Exceptions/NotFoundException.cs b/src/DigitalData.MessagingService.Domain/Exceptions/NotFoundException.cs index d065f52..ba9852b 100644 --- a/src/DigitalData.MessagingService.Domain/Exceptions/NotFoundException.cs +++ b/src/DigitalData.MessagingService.Domain/Exceptions/NotFoundException.cs @@ -1,22 +1,21 @@ -namespace DigitalData.MessagingService.Domain.Exceptions; - -/// -/// Exception thrown when a requested entity is not found. -/// -public class NotFoundException : Exception +namespace DigitalData.MessagingService.Domain.Exceptions { - public NotFoundException(string entityName, object key) - : base($"{entityName} with key '{key}' was not found.") + /// + /// Exception thrown when a requested entity is not found. + /// + public class NotFoundException : Exception { - } + public NotFoundException(string entityName, object key) : base($"{entityName} with key '{key}' was not found.") + { + } - public NotFoundException(string message) - : base(message) - { - } + public NotFoundException(string message) : base(message) + { + } - public NotFoundException(string message, Exception innerException) - : base(message, innerException) - { + public NotFoundException(string message, Exception innerException) + : base(message, innerException) + { + } } -} +} \ No newline at end of file