private void HandleInvalidModelStateException(ExceptionContext context) { var exception = new ValidateModelException(context.ModelState); context.Result = new BadRequestObjectResult(ServiceResult.Failed(exception.Errors, ServiceError.ValidationFormat)); context.ExceptionHandled = true; }
public void DefaultConstructorCreatesAnEmptyErrorDictionary() { var actual = new ValidateModelException().Errors; actual.Keys.Should().BeEquivalentTo(Array.Empty <string>()); }