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">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFrameworks>net462;net8.0</TargetFrameworks>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
namespace DigitalData.MessagingService.Domain.Exceptions;
|
namespace DigitalData.MessagingService.Domain.Exceptions
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exception thrown when OAuth2 authentication fails.
|
|
||||||
/// </summary>
|
|
||||||
public class AuthenticationFailedException : Exception
|
|
||||||
{
|
{
|
||||||
public AuthenticationFailedException(string message)
|
/// <summary>
|
||||||
: base(message)
|
/// Exception thrown when OAuth2 authentication fails.
|
||||||
|
/// </summary>
|
||||||
|
public class AuthenticationFailedException : Exception
|
||||||
{
|
{
|
||||||
}
|
public AuthenticationFailedException(string message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public AuthenticationFailedException(string message, Exception innerException)
|
public AuthenticationFailedException(string message, Exception innerException) : base(message, innerException)
|
||||||
: base(message, innerException)
|
{
|
||||||
{
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,21 @@
|
|||||||
namespace DigitalData.MessagingService.Domain.Exceptions;
|
namespace DigitalData.MessagingService.Domain.Exceptions
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exception thrown when a requested entity is not found.
|
|
||||||
/// </summary>
|
|
||||||
public class NotFoundException : Exception
|
|
||||||
{
|
{
|
||||||
public NotFoundException(string entityName, object key)
|
/// <summary>
|
||||||
: base($"{entityName} with key '{key}' was not found.")
|
/// 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)
|
public NotFoundException(string message) : base(message)
|
||||||
: base(message)
|
{
|
||||||
{
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public NotFoundException(string message, Exception innerException)
|
public NotFoundException(string message, Exception innerException)
|
||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user