Jaa


RenameProperty Method

Renames an existing property and returns a CatalogProperty object containing the renamed property.

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

Syntax

'Declaration
Public Function RenameProperty ( _
    oldName As String, _
    newName As String _
) As CatalogProperty
'Usage
Dim instance As CatalogContext
Dim oldName As String
Dim newName As String
Dim returnValue As CatalogProperty

returnValue = instance.RenameProperty(oldName, _
    newName)
public CatalogProperty RenameProperty(
    string oldName,
    string newName
)
public:
CatalogProperty^ RenameProperty(
    String^ oldName, 
    String^ newName
)
public function RenameProperty(
    oldName : String, 
    newName : String
) : CatalogProperty

Parameters

  • oldName
    Type: System..::.String
    The old name of the property. Should not be nullNothingnullptra null reference (Nothing in Visual Basic).
  • newName
    Type: System..::.String
    The new name for the property. Should not be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: Microsoft.CommerceServer.Catalog..::.CatalogProperty
A CatalogProperty object containing the renamed catalog property.

Exceptions

Exception Condition
EntityAlreadyExistsException

The newName already exists in the catalog system.

EntityDoesNotExistException

The oldName does not exist in the catalog system.

NotAuthorizedException

The caller is not authorized to perform this operation.

Remarks

This method will rename the property and return a CatalogProperty object containing the renamed property. You can then use the CatalogProperty object to access and update information about the new property.

The property names specified by oldName or newName should:

  • Not be nullNothingnullptra null reference (Nothing in Visual Basic) or blank.

  • Not exceed 100 characters.

  • Not contain the .,"[] characters.

  • Not begin with a digit.

Examples

This example shows how to rename a property.

private void RenameProperty(CatalogContext catalogContext)
{
  CatalogProperty property = catalogContext.RenameProperty("OldPropertyName", "NewPropertyName");
  }

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

Microsoft.CommerceServer.Catalog Namespace