Skip to main content

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

NameTypeDescription
fieldNamestringField name
You cannot specify null or an empty string.
oppositeIModelThe associated model
Cannot be null.

Return value

  • bool

Exceptions

NameException ClassDescription
Invalid argumentExtensionArgumentExceptionIf null is specified for opposite
If null or an empty string is specified for fieldName
Field not foundExtensionFieldNotFoundExceptionIf the specified field is not found in this instance's metaclass