RuleSet.ValidateAllTargets(IObjectSpace, IEnumerable, ContextIdentifiers) 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
NuGet Package: DevExpress.Persistent.Base
#Declaration
public RuleSetValidationResult ValidateAllTargets(
IObjectSpace targetObjectSpace,
IEnumerable targets,
ContextIdentifiers contextIDs
)
#Parameters
Name | Type | Description |
---|---|---|
target |
IObject |
An IObject |
targets | IEnumerable | The list of objects to check. |
context |
Context |
The Context |
#Returns
Type | Description |
---|---|
DevExpress. |
The result of the Rule |
#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.
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ValidateAllTargets(IObjectSpace, IEnumerable, ContextIdentifiers) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.