IModel.RelateWhere Method
Namespace: NextDesign.Core
Description
Relates the specified model with all reference fields that match the specified conditions of this instance, and returns a collection of all related instances added.
If a deleted model or temporary proxy is specified as the model to be related, no association is made.
If no association is made, an empty collection is returned.
The reference field to be related can be determined arbitrarily by the evaluation function.
However, if the field matches the evaluation function but meets the following conditions, no association is made and the program terminates normally.
- If the field path constraint is violated
- If the field type is not compatible with the given model
- If the field multiplicity is exceeded
- If the field that matches the condition is one of the following non-operational fields
- Product line feature assignment fields
- Fields with the System.Core tag
Arguments
Name | Type | Description |
---|---|---|
opposite | IModel | Model to associate null cannot be specified. |
predicate | Func<IField, bool> | Field evaluation function First argument: Field Return value: True if the corresponding field is used for association If null is specified, returns a collection of all associated instances added by associating the given model with the given model of this instance through all possible reference fields that can be associated with it. |
Return value
- IRelationshipCollection
Exception
Name | Exception class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | If null is specified for opposite |
Invalid operation | ExtensionInvalidOperationException | If the model itself is a deleted model or a temporary proxy |