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 `<TargetFramework>`
with `<TargetFrameworks>`.
Reformatted `AuthenticationFailedException` and
`NotFoundException` classes to use braces `{ }` for namespaces
and constructors for consistency. No functional changes were made
to the exception classes.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFrameworks>net462;net8.0</TargetFrameworks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
namespace DigitalData.MessagingService.Domain.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Exception thrown when OAuth2 authentication fails.
|
||||
/// </summary>
|
||||
public class AuthenticationFailedException : Exception
|
||||
namespace DigitalData.MessagingService.Domain.Exceptions
|
||||
{
|
||||
public AuthenticationFailedException(string message)
|
||||
: base(message)
|
||||
/// <summary>
|
||||
/// Exception thrown when OAuth2 authentication fails.
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,21 @@
|
||||
namespace DigitalData.MessagingService.Domain.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Exception thrown when a requested entity is not found.
|
||||
/// </summary>
|
||||
public class NotFoundException : Exception
|
||||
namespace DigitalData.MessagingService.Domain.Exceptions
|
||||
{
|
||||
public NotFoundException(string entityName, object key)
|
||||
: base($"{entityName} with key '{key}' was not found.")
|
||||
/// <summary>
|
||||
/// Exception thrown when a requested entity is not found.
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user