Use file scoped namepace
This commit is contained in:
@@ -2,18 +2,17 @@
|
||||
using GerstITS.Data;
|
||||
using GerstITS.Web.Api.ExceptionHandling;
|
||||
|
||||
namespace GerstITS.Examples.Api.ExceptionHandling
|
||||
namespace GerstITS.Examples.Api.ExceptionHandling;
|
||||
|
||||
public class EntityNotFoundExceptionTransformation : ExceptionTransformationBase<EntityNotFoundException>
|
||||
{
|
||||
public class EntityNotFoundExceptionTransformation : ExceptionTransformationBase<EntityNotFoundException>
|
||||
protected override ExceptionTransformationInfo CreateExceptionTransformationInfo(EntityNotFoundException exception, string ticketId)
|
||||
{
|
||||
protected override ExceptionTransformationInfo CreateExceptionTransformationInfo(EntityNotFoundException exception, string ticketId)
|
||||
return new ExceptionTransformationInfo
|
||||
{
|
||||
return new ExceptionTransformationInfo
|
||||
{
|
||||
StatusCode = HttpStatusCode.NotFound,
|
||||
ReasonPhrase = "Enitity nicht gefunden",
|
||||
Details = exception.Message
|
||||
};
|
||||
}
|
||||
StatusCode = HttpStatusCode.NotFound,
|
||||
ReasonPhrase = "Enitity nicht gefunden",
|
||||
Details = exception.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,22 +2,21 @@
|
||||
using System.Net;
|
||||
using GerstITS.Web.Api.ExceptionHandling;
|
||||
|
||||
namespace GerstITS.Examples.Api.ExceptionHandling
|
||||
{
|
||||
internal sealed class ValidationExceptionTransformation : ExceptionTransformationBase<ValidationException>
|
||||
{
|
||||
#region Methods
|
||||
namespace GerstITS.Examples.Api.ExceptionHandling;
|
||||
|
||||
protected override ExceptionTransformationInfo CreateExceptionTransformationInfo(ValidationException exception, string ticketId)
|
||||
internal sealed class ValidationExceptionTransformation : ExceptionTransformationBase<ValidationException>
|
||||
{
|
||||
#region Methods
|
||||
|
||||
protected override ExceptionTransformationInfo CreateExceptionTransformationInfo(ValidationException exception, string ticketId)
|
||||
{
|
||||
return new ExceptionTransformationInfo
|
||||
{
|
||||
return new ExceptionTransformationInfo
|
||||
{
|
||||
StatusCode = HttpStatusCode.BadRequest,
|
||||
ReasonPhrase = "Validierungsfehler",
|
||||
Details = exception.Message
|
||||
};
|
||||
}
|
||||
StatusCode = HttpStatusCode.BadRequest,
|
||||
ReasonPhrase = "Validierungsfehler",
|
||||
Details = exception.Message
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user