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 it can be associated. This method evaluates not only the field type, but also the following field constraints: [Constraints to evaluate]
- Path constraint
- Type constraints
- Multiplicity upper limit
If the model itself or the associated model is a deleted model or a temporary proxy, False is returned. It also returns False if the following fields are specified:
- Product line feature assignment field
- Field with System.Core tag
- Owned field
argument
Name | Type | Description |
---|---|---|
fieldName | string | Field name Null or an empty string cannot be specified. |
opposite | IModel | Associate model Null cannot be specified. |
Return value
- bool
Exception
Name | Exception Class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | When null is specified for opposite When 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 |