Skip to main content

IModel.SetInitField Method

Namespace: NextDesign.Core

Description

Sets the initial value of the field defined in the metamodel to the specified field of this instance.
If the metamodel does not specify an initial value for the field, the default value of the field type is set.
If this method is called for an owned field of a class type, the IModel set as the field value is deleted.
Also, if this method is called for a reference field of a class type, the association with the IModel set as the field value is deleted (the IModel of the field value is not deleted and is maintained).

Arguments

NameTypeDescription
fieldNamestringField name
Null or an empty string cannot be specified.

Return value

  • void

Exception

NameException classDescription
Invalid argumentExtensionArgumentExceptionIf null or an empty string is specified for fieldName
Field not foundExtensionFieldNotFoundExceptionIf the specified field is not found in the metaclass of this instance
Invalid operationExtensionInvalidOperationExceptionIf this is a deleted model or a temporary proxy
If an inoperable field is specified for the field name
- Feature assignment field of a product line
- Field with the System.Core tag