using System.ComponentModel.DataAnnotations; using System.Net; using GerstITS.Web.Api.ExceptionHandling; namespace GerstITS.Examples.Api.ExceptionHandling { internal sealed class ValidationExceptionTransformation : ExceptionTransformationBase { #region Methods protected override ExceptionTransformationInfo CreateExceptionTransformationInfo(ValidationException exception, string ticketId) { return new ExceptionTransformationInfo { StatusCode = HttpStatusCode.BadRequest, ReasonPhrase = "Validierungsfehler", Details = exception.Message }; } #endregion } }