Partilhar via


AddProperty Method

Adds a property to the current definition.

Namespace:  Microsoft.CommerceServer.Catalog
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Sub AddProperty ( _
    propertyName As String, _
    definitionPropertyType As DefinitionPropertyType _
)
'Usage
Dim instance As CatalogDefinition
Dim propertyName As String
Dim definitionPropertyType As DefinitionPropertyType

instance.AddProperty(propertyName, definitionPropertyType)
public void AddProperty(
    string propertyName,
    DefinitionPropertyType definitionPropertyType
)
public:
void AddProperty(
    String^ propertyName, 
    DefinitionPropertyType definitionPropertyType
)
public function AddProperty(
    propertyName : String, 
    definitionPropertyType : DefinitionPropertyType
)

Parameters

  • propertyName
    Type: System..::.String
    The name of the property to add. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

The propertyName is null.

ValidationException

The propertyName is invalid.

Remarks

This method adds the propertyName of the specified definitionPropertyType to the current definition.

The propertyName cannot:

  • be null or blank.

  • exceed 100 characters.

  • contain the .,"[] characters.

  • begin with a digit.

  • exist in the catalog system.

The definitionPropertyType can be VariantProperty only if the current definition is a ProductDefinition. If you make any changes to this definition you should call the Save method to save the changes to the catalog system. If you add a VariantProperty to a ProductDefinition for the first time and that definition is being used in catalogs then all the products based on that definition will be changed to product families.

Permissions

See Also

Reference

CatalogDefinition Class

CatalogDefinition Members

Microsoft.CommerceServer.Catalog Namespace