IModel.CanRelate method
Namespace: NextDesign.Core
Description
Checks if the specified field of this instance can be associated with the given model.
Returns True if the association is possible.
This method evaluates not only the field type, but also the following field constraints:
[constraint to evaluate]
- Path constraints
- type constraints
- Multiplicity upper bound
In addition, returns False if the model itself or the associated model is a deleted model or a temporary proxy.
Also returns False if the following fields are specified:
- Product line feature assignment field
- Fields tagged with System.Core
- owned field
argument
Name | Type | Description |
---|---|---|
fieldName | string | Field name You cannot specify null or an empty string. |
opposite | IModel | The associated model Cannot be null. |
Return value
- bool
Exceptions
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 this instance's metaclass |