-
Notifications
You must be signed in to change notification settings - Fork 1
M_Ifp_Validation_ValidationRule_1_ValidateObject
Martin Strecker edited this page Mar 9, 2019
·
6 revisions
Checks the objectToValidate and returns a ValidationOutcome.
Namespace: Ifp.Validation
Assembly: Ifp.Validation (in Ifp.Validation.dll) Version: 1.4.0
C#
public abstract ValidationOutcome ValidateObject(
T objectToValidate
)
VB
Public MustOverride Function ValidateObject (
objectToValidate As T
) As ValidationOutcome
C++
public:
virtual ValidationOutcome^ ValidateObject(
T objectToValidate
) abstract
F#
abstract ValidateObject :
objectToValidate : 'T -> ValidationOutcome
- objectToValidate
- Type: T
The object to validate.
Type: ValidationOutcome
A ValidationOutcome that represents the result of the validation.
IValidationRule(T).ValidateObject(T)
You can use the ToFailure(String, FailureSeverity) extension method to construct a ValidationOutcome.
Indicate success by returning Success.
C#
public override ValidationOutcome ValidateObject(Animal objectToValidate)
{
return ValidationOutcome.Success;
}
Return a ValidationOutcome by using the Failure(FailureSeverity, String) method.
C#
public override ValidationOutcome ValidateObject(Animal objectToValidate)
{
return ValidationOutcome.Failure(FailureSeverity.Error, "This is an error message.");
}
Return a ValidationOutcome using the String extension method ToFailure(String, FailureSeverity).
C#
public override ValidationOutcome ValidateObject(Animal objectToValidate)
{
return "This is an error message.".ToFailure(FailureSeverity.Error);
}
A Sandcastle Documented Class Library
Send comments on this topic to [](mailto:?Subject=A Sandcastle Documented Class Library)
-
Ifp.Validation Namespace
- CollectionValidator(T) Class
- FailureSeverity Enumeration
- IValidationRule(T) Interface
-
IValidationSummaryPresentationService Interface
-
IValidationSummaryPresentationService Methods
-
IValidationSummaryPresentationService.ShowValidationSummary Method
- IValidationSummaryPresentationService.ShowValidationSummary Method (ValidationSummary)
- IValidationSummaryPresentationService.ShowValidationSummary Method (ValidationSummary, Boolean)
- IValidationSummaryPresentationService.ShowValidationSummary Method (ValidationSummary, Boolean, String)
- IValidationSummaryPresentationService.ShowValidationSummary Method (ValidationSummary, Boolean, String, String)
-
IValidationSummaryPresentationService.ShowValidationSummary Method
-
IValidationSummaryPresentationService Methods
- IValidator(T) Interface
- RuleBasedValidator(T) Class
- SubCollectionValidator(T, U) Class
- ValidationFunction(T) Delegate
- ValidationOutcome Class
- ValidationOutcomeWithMessage Class
- ValidationRule(T) Class
- ValidationRuleDelegate(T) Class
-
ValidationSeverity Class
- ValidationSeverity Constructor
-
ValidationSeverity Properties
- ValidationSeverity.AllowsCancel Property
- ValidationSeverity.CausesCancel Property
- ValidationSeverity.Error Property
- ValidationSeverity.Information Property
- ValidationSeverity.IsAnError Property
- ValidationSeverity.SeverityAsNumber Property
- ValidationSeverity.Success Property
- ValidationSeverity.Warning Property
- ValidationSeverity Methods
- ValidationSeverity.ErrorSeverity Class
- ValidationSeverity.InformationSeverity Class
- ValidationSeverity.SuccessSeverity Class
- ValidationSeverity.WarningSeverity Class
- ValidationSummary Class
- ValidationSummaryBuilder Class
- ValidationSummaryBuilderExtensions Class
- Validator(T) Class
- ValidatorCombiner(T) Class