IModel.CanRelate method

Namespace: NextDesign.Core

Description

Checks if the specified field in 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: [Constraint to evaluate] - Path constraint - Type constraints - Multiplicity limit

If the model to be associated with itself or the deleted model is 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 empty string cannot be specified.
opposite IModel The model to associate
null cannot be specified.

Return value

  • bool

Exception

Name Exception Class Description
Invalid argument ExtensionArgumentException When null is specified for opposite
When null or empty string is specified for fieldName
Field not found ExtensionFieldNotFoundException If the specified field is not found in this instance's metaclass