Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RuleSet.ValidateAllTargets(IObjectSpace, IEnumerable) Method

Silently (without raising the RuleSet.ValidationCompleted event and throwing the ValidationException) validates multiple targets and returns the result.

Namespace: DevExpress.Persistent.Validation

Assembly: DevExpress.Persistent.Base.v24.2.dll

#Declaration

public RuleSetValidationResult ValidateAllTargets(
    IObjectSpace targetObjectSpace,
    IEnumerable targets
)

#Parameters

Name Type Description
targetObjectSpace IObjectSpace

An IObjectSpace used by a validation targets.

targets IEnumerable

The list of objects to check.

#Returns

Type Description
DevExpress.Persistent.Validation.RuleSetValidationResult

The result of the RuleSet validation.

#Remarks

Below is the example of using the ValidateAllTargets method and handling its result.

RuleSetValidationResult validationResult = Validator.RuleSet.ValidateAllTargets(
    ObjectSpace, ObjectSpace.GetObjectsToSave(false), ContextIdentifier.Save);
ValidationResults obj = new ValidationResults(validationResult, base.Application.Model);
bool flag = validationResult.State != ValidationState.Invalid;

This method raises the RuleSet.RuleValidated event for each target.

See Also