IModel.CanRelate Method
Namespace: NextDesign.Core
Description
Checks whether the specified field of this instance can be related to the specified model.
Returns True if the relationship is possible.
This method evaluates not only the field type but also the following field constraints.
[Constraints to evaluate]
- Path constraint
- Type constraint
- Upper multiplicity limit
Note that if the model itself or the model to be related is a deleted model or a temporary proxy, False is returned.
Also, if the following fields are specified, False is returned.
- Product line feature assignment fields
- Fields tagged with System.Core
- Owned fields
- Invalid fields
Arguments
Name | Type | Description |
---|---|---|
fieldName | string | Field name Cannot be null or an empty string. |
opposite | IModel | Associated model Cannot be null. |
Return value
- bool
Exception
Name | Exception class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | If null is specified for opposite If null or an empty string is specified for fieldName |
Field not found | ExtensionFieldNotFoundException | If the specified field is not found in the metaclass of this instance |