20 lines
657 B
C#
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
|
|
};
|
|
}
|
|
}
|
|
}
|