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