IModel.RelateAt Method
Namespace: NextDesign.Core
Description
Relates the specified model to the specified field of this instance by specifying the addition position, and returns the added related instance.
Arguments
Name | Type | Description |
---|---|---|
fieldName | string | Field name Null or an empty string cannot be specified. |
opposite | IModel | Model to associate Null cannot be specified. |
direction | string | Addition direction in the association field - "first" : Beginning - "last" : End - "before" : Before - "after" : After |
index | int | Addition reference position Specify an index with the first position being 0. If "direction" is specified as "first", the association will be made at the beginning regardless of the index value. If "direction" is specified as "last", the association will be made at the end regardless of the index value. If "before" is specified as "direction", the instance will be associated at the specified position, and if "after", the instance will be associated at the position following the specified position. |
Return value
Exception
Name | Exception class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | If null is specified for opposite If null or an empty string is specified for fieldName If a string other than the default string is specified for direction |
Field not found | ExtensionFieldNotFoundException | If the specified field is not found in the metaclass of the destination instance |
Invalid index range | ExtensionOutOfRangeException | If a negative number is specified for index Or if a value greater than the number of elements in the corresponding field is specified for index |
Invalid operation | ExtensionInvalidOperationException | If the model itself is a deleted model or a temporary proxy If an inoperable field is specified for the field name - Product line feature assignment fields - Fields tagged with System.Core - Owned fields If an invalid field is specified |
Constraint violation | ExtensionIllegalFieldAccessException | If the model to be associated is not compatible with the data type of the specified field If the association violates the multiplicity constraint of the field If the association violates the path constraint of the field |
An invalid model is specified | ExtensionInvalidModelException | If a deleted model or temporary proxy is specified as the model to be associated |