Files
Examples/GerstITS.Examples.Api/Common/ExceptionHandling/Transformations/EntityNotFoundExceptionTransformation.cs
2021-06-15 10:59:47 +02:00

20 lines
657 B
C#

using System.Net;
using GerstITS.Data;
using GerstITS.Web.Api.ExceptionHandling;
namespace GerstITS.Examples.Api.ExceptionHandling
{
public class EntityNotFoundExceptionTransformation : ExceptionTransformationBase<EntityNotFoundException>
{
protected override ExceptionTransformationInfo CreateExceptionTransformationInfo(EntityNotFoundException exception, string ticketId)
{
return new ExceptionTransformationInfo
{
StatusCode = HttpStatusCode.NotFound,
ReasonPhrase = "Enitity nicht gefunden",
Details = exception.Message
};
}
}
}