IModel.RelateAt method
Namespace: NextDesign.Core
Description
Returns an added associated instance that associates the given model with the specified add position on the specified field of this instance.
argument
Name | Type | Description |
---|---|---|
fieldName | string | Field name You cannot specify null or an empty string. |
opposite | IModel | The associated model Cannot be null. |
direction | string | Addition direction in association field - "first" : beginning - "last" : end - "before" : before - "after" : after |
index | int | Additional reference position Specifies the index with 0 as the starting position. If direction is specified as "first", it will be associated at the beginning regardless of the index value. If direction is specified as "last", it will be associated at the end regardless of the index value. If the direction is specified as "before", the instance will be associated with the specified position, and if it is "after", the instance will be associated with the position next to the specified position. |
Return value
Exceptions
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 | When a negative number is specified for index or when a value greater than the number of elements in the corresponding field is specified for index |
Illegal operation | ExtensionInvalidOperationException | If the model itself is a deleted model or a temporary proxy If an inoperable field is specified in the field name - Product line feature assignment field - System. Core tagged fields - owning fields |
Constraint Violation | ExtensionIllegalFieldAccessException | If the associated model is incompatible with the data type of the specified field If the association violates the multiplicity constraint of the field The association violates the path constraint of the field case |
ExtensionInvalidModelException with an invalid model |