IModel.RelateWhere method
Namespace: NextDesign.Core
Description
Associates the given model with all reference fields that match the specified criteria for this instance and returns a collection of all associated instances added.
If a deleted model or temporary proxy is specified as the model to be associated, the association will not be performed.
Returns an empty collection if no association was made.
The reference field to be associated can be determined arbitrarily using the evaluation function.
However, even if the evaluation function is matched, if the field meets the following conditions, no association will be made and the process will end normally.
・When field path constraints are violated
・If the field type is not compatible with the given model
・When the multiplicity of the field is exceeded
・If the field that matches the condition is one of the following non-operable fields
- Product line feature assignment field
- Fields tagged with System.Core
argument
Name | Type | Description |
---|---|---|
opposite | IModel | Model to be associated Null cannot be specified. |
predicate | Func<IField, bool> | Field evaluation function First argument: Field Return value: True if associated with the corresponding field Null is specified. , associates the given model with all reference fields that can be associated with this instance's given model, and returns a collection of all added related instances. |
Return value
- IRelationshipCollection
Exception
Name | Exception class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | If null is specified for opposite |
Unauthorized operation | ExtensionInvalidOperationException | If the model is a deleted model or a temporary proxy |