public static void Default(IErrorBuilder errorBuilder, ErrorMappingContext mappingContext) { errorBuilder .SetCode(Code) .SetPath(mappingContext.MiddlewareContext.Path) .SetMessage(mappingContext.ValidationFailure.ErrorMessage); }
public static void Extended(IErrorBuilder errorBuilder, ErrorMappingContext mappingContext) { errorBuilder .SetExtension(ExtensionKeys.AttemptedValueKey, mappingContext.ValidationFailure.AttemptedValue) .SetExtension(ExtensionKeys.CustomStateKey, mappingContext.ValidationFailure.CustomState) .SetExtension( ExtensionKeys.FormattedMessagePlaceholderValuesKey, mappingContext.ValidationFailure.FormattedMessagePlaceholderValues); }
public static void Details(IErrorBuilder errorBuilder, ErrorMappingContext mappingContext) { errorBuilder .SetExtension(ExtensionKeys.ValidatorKey, mappingContext.ValidationFailure.ErrorCode) .SetExtension(ExtensionKeys.FieldKey, mappingContext.MiddlewareContext.Field.Name) .SetExtension(ExtensionKeys.ArgumentKey, mappingContext.Argument.Name) .SetExtension(ExtensionKeys.PropertyKey, mappingContext.ValidationFailure.PropertyName) .SetExtension(ExtensionKeys.SeverityKey, mappingContext.ValidationFailure.Severity); }