Share via


Commerce Foundation UserProfile CommerceDelete

This Commerce Server 2009 operation is used to delete an existing user profile object. Care should be taken when deciding to delete a user profile, as it is deleted permanently from the system. This operation will also delete any related items that are not currently in use, for example, addresses and credit cards.

Syntax

        var deleteUserProfile = new CommerceDelete<CommerceEntity>("UserProfile");
      

Parameters

This operation requires the ID or e-mail address of the user profile that you want to delete. This operation supports the CommerceModelSearch<UserProfile> criteria mechanism only.

Parameter

Description

Id

Specifies the Id of the UserProfile to delete. Required if Email is not specified. If both Email and Id are specified, an exception will be thrown.

Email

Specifies the email address of the UserProfile to delete. Required if Id is not specified. If both Email and Id are specified, an exception will be thrown.

Operation Sequence Components

Operation Sequence Component

Description

UserProfileLoader

Loads the Commerce Server component and caches it for further Operation Sequence processing.

UserProfileAddressesProcessor

Deletes the addresses associated with this user profile if they are not in use by other users.

UserProfileCreditCardsProcessor

Deletes the credit cards associated with this user if they are not in use by another user.

UserProfileCommitter

Deletes the user from Commerce Server.

UserProfileResponseBuilder

Converts the user profiles of the cached Commerce Server to Commerce Server 2009 user profiles and adds them to the response.

UserProfileAddressResponseBuilder

Converts Commerce Server addresses to Commerce Server 2009 addresses and adds them to the response.

UserProfileCreditCardsResponseBuilder

Converts Commerce Server credit cards to Commerce Server 2009 credit cards and adds them to the response.

UserProfileShippingMethodsResponseBuilder

Converts Commerce Server shipping methods to Commerce Server 2009 shipping methods and adds them to the response.

Valid Delete Operation Parameters

Parameters

Description

SearchCriteria.Model type(s)

An exception will be thrown if any model type other than UserProfile is specified.

SearchCriteria.Model.Id

ID of the user to delete.

SearchCriteria.Model.Email

E-mail address of the user to delete.

Exceptions

This operation does not throw any exceptions that Microsoft Multi-Channel Commerce Foundation is expected to handle.

Remarks

Commerce Server will throw an exception if an attempt is made to delete a profile with an ID that does not exist. Microsoft Multi-Channel Commerce Foundation does not throw an exception in this case; however, the items deleted count will not be incremented.

See Also

Other Resources

Developing with the Commerce Foundation Profiles System

Commerce Foundation User Profile

Commerce Foundation UserProfile CommerceCreate

Commerce Foundation UserProfile CommerceQuery

Commerce Foundation UserProfile CommerceUpdate

CommerceDelete