IModel.RelateAt method
Namespace: NextDesign.Core
Description
Returns the added related instance, associating the given model with the specified additional position in the specified field of this instance.
argument
Name | Type | Description |
---|---|---|
fieldName | string | Field name Null or an empty string cannot be specified. |
opposite | IModel | Associate model Null cannot be specified. |
direction | string | Addition direction in the associated field -"first": First -"last": Last -"before": Before -"after": After |
index | int | Additional reference position Specify the index with the start position as 0. If the direction is specified as "first", it will be associated at the beginning regardless of the index value. If the direction is specified as "last", it will be associated at the end regardless of the index value. If the direction specification is "before", the instance is associated with the specified position, and if it is "after", the instance is associated with the position next to the specified position. |
Return value
Exception
Name | Exception Class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | When null is specified for opposite When null or an empty string is specified for fieldName When a character string other than the default character 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 or equal to the number of elements in the corresponding field is specified for index |
Illegal operation | ExtensionInvalidOperationException | If it is a deleted model or temporary proxy If an inoperable field is specified in the field name -Product line feature assignment field -System. Fields with Core tags -Owned fields |
Constraint violation | ExtensionIllegalFieldAccessException | When the associated model is incompatible with the specified field data type When the association violates the field multiplicity constraint The association violates the field path constraint. If |
Invalid model specified | ExtensionInvalidModelException | When a deleted model or temporary proxy is specified for the associated model |