Skip to main content

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

NameTypeDescription
fieldNamestringField Name
Cannot be null or an empty string.
It must also be an owned field of a class type.
classNamestringClass 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

NameException ClassDescription
Invalid ArgumentExtensionArgumentExceptionWhen null or an empty string is specified for fieldName or className
Field Not FoundExtensionFieldNotFoundExceptionWhen the specified field is not found in this instance's metaclass
Invalid Specified FieldExtensionInvalidTypeExceptionWhen 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 FoundExtensionTypeNotFoundExceptionWhen the specified class is not found
Invalid OperationExtensionInvalidOperationExceptionWhen 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