Files
Examples/GerstITS.Examples.Api/Common/ExceptionHandling/Transformations/EntityNotFoundExceptionTransformation.cs
2023-12-18 12:10:34 +01:00

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
}