IModel.AddNewModel Method
Namespace: NextDesign.Core
Description
This method appends an instance of the specified class as a field value to the end of the specified field in this instance.
However, if the specified field has a multiplicity limit of 1 and already has an instance in that field, it replaces the first instance.
It also adds an instance of an abstract class.
Argument
| Name | Type | Description |
|---|---|---|
| fieldName | string | Field Name Cannot be null or an empty string. It must also be an owned field of a class type. |
| className | string | Class Name Specify the name or fully qualified name of the class. Cannot be null or an empty string. It must also be a type compatible with the field's data type. |
Return value
Exceptions
| Name | Exception Class | Description |
|---|---|---|
| Invalid Argument | ExtensionArgumentException | When null or an empty string is specified for fieldName or className |
| Field Not Found | ExtensionFieldNotFoundException | When the specified field is not found in this instance's metaclass |
| Invalid Specified Field | ExtensionInvalidTypeException | When an invalid value is specified for the specified field - The specified field is not an owned field - The data type of the specified field is not a class type - The type of the specified field and the specified class are incompatible |
| Class Not Found | ExtensionTypeNotFoundException | When the specified class is not found |
| Invalid Operation | ExtensionInvalidOperationException | When this is a deleted model or temporary proxy When an unoperable field is specified as the field name - Product line feature assignment field - Fields tagged with System.Core If an invalid field is specified |