Commerce Foundation Operations

A Microsoft Multi-Channel Commerce Foundation operation request comprises four main components:

  1. The search criteria

  2. The model

  3. The related operations

  4. Operation specific options

You use operations to manipulate one or more top-level commerce entities. You use CommerceRelatedOperations to manipulate entities related to commerce entities. Some commerce entities, such as Address and CreditCards, cannot be retrieved directly through an operation because they are only meaningful in the context of their parent entity. You must use a CommerceRelatedOperation to manipulate these entities. A concrete class exists for each Microsoft Multi-Channel Commerce Foundation operation.

Dd464343.21c52135-51b7-4c1c-a19d-7093b56b0620(en-us,CS.95).gif

Search Criteria

Microsoft Multi-Channel Commerce Foundation supports two search criteria types, CommerceModelSearch and CommerceCatalogFullTextSearch.

Dd464343.57691e55-27ea-4df0-a2bf-180dee133b25(en-us,CS.95).gif

Class

Description

CommerceSearchCriteria

Base class of every search criteria.

PropertyDescription
NumberOfItemsToReturnAn optional parameter that supports result set paging. It indicates the maximum number of items to return from the query. If this parameter is null, all items are returned.
SortPropertiesIdentifies the properties to sort on. If none are specified, no sorting is applied and information is returned in the order of the data store. Each SortProperty specified allows you to specify the property to sort on and the SortType (Ascending, Descending or None).Note: For catalog entity models such as Categories, Products, and Variants, you can only sort on the common Commerce Server properties. If you attempt to sort on definition specific properties, an exception will be thrown.
FirstItemIndexAn optional parameter that supports result set paging. This 0 based index indicates the position of the first record to be returned.
ReturnTotalItemCountAn optional parameter that supports result set paging. When True, the total number of items matching the provided search criteria is returned in the response.
WhereClauseUse to specify additional search criteria that are inserted as part of the T-SQL WHERE clause. For example, filtering products with a category to only select the products that are on sale.

CommerceModelSearch

CommerceModelSearch specifies simple queries (key/value only) based on the CommerceEntity model. This provides a developer-friendly strongly-typed search capability. Using the same model approach can be used to allow generic tools to formulate simple queries too. This is enabled by the Model definition.

CommerceCatalogFullTextSearch

CommerceCatalogFullTextSearch performs a full text search in the catalog system.

PropertyDescription
CatalogsThis property indicates which catalogs will be search. If this property is null or empty all catalogs are searched otherwise only the specified catalogs are searched.
InventorFiltersThis property indicates what inventory attributes to apply when products are returned as part of the full text search. These can be ORed (|) together to return products that satisfy multiple inventory filter criteria.
PhraseThis property is used to specify the search phrase to be applied to the full text search.
FullTextSearchTypeThis property identifies the type of catalog full text that will be applied. If is specified, a Commerce Server UseAdvancedFreeText will be set to true otherwise it will be set to false.
ContainsThis property indicates which catalog commerce entities need to be search and returned as part of the operation. The caller of the API can OR(|) type types to increase or limit the scope of the desired commerce entities.
TypesToSearchThis property is used to specify the search phrase to be applied to the full text search. These can be ORed together to return a variety of CatalogEntities.

Model

The Model is an integral part of each operation. It identifies the target commerce entity type or related commerce entity type onto which the operation is performed. The way the Model is populated affects the behavior of the operation.

Operation

Model

CommerceCreate

The model identifies the property values that will be assigned to the newly created item.

CommerceDelete

The model has no action for this operation.

CommerceQuery

The model identifies the properties of the items matching that search criteria that will be returned in the operation response. If the model is null or contains no properties, all properties of the items will be returned.

CommerceUpdate

The model identifies the properties of the item(s) matching the search criteria that will be altered.

The related operations identify how other items are related to the model.

Related Operation

Description

CommerceCopyRelatedItem

Creates a copy of an existing commerce entity and relates it to the entity that is the target of the parent operation.

CommerceCreateRelatedItem

Creates a new commerce entity and relates it to the entity that is the target of the parent operation.

CommerceCreateRelationship

Relates an existing commerce entity to the entity that is the target of the parent operation.

CommerceDeleteRelatedItem

Deletes an existing commerce entity and its relationship to the entity that is the target of the parent operation.

CommerceDeleteRelationship

Removes the relationship between an existing commerce entity and the entity that is the target of the parent operation.

CommerceQueryRelatedItem

Retrieves the commerce entities that are related to the entity that is the target of the parent operation.

CommerceQueryRelationship

Retrieves information about how entities are related to the target of the parent operation. This only retrieves the relationship object, not the actual commerce entity.

CommerceUpdatedRelatedItem

Manipulates the properties of an existing commerce entity that is related to the entity that is the target of the parent operation.

CommerceUpdateRelationship

Manipulates properties of the relationship that links a commerce entity to the entity that is the target of the parent operation.

Operation Specific Options

These are the list of options specific to a model.

Options

Description

CommerceCreateOptions

Applies to CommerceCreate operation.

PropertyDescription
ReturnModelThis property indicates which properties of the commerce entity created should be returned in the response. If the property is Null, the entity created will be returned in the response.
ReturnModelQueriesThis property specifies the CommerceQueryRelatedItem operations that will be used to populate the relationships of the commerce entity returned in the response. If Return Model is Null, the ReturnModelQueries is ignored.

CommerceDeleteOptions

Applies to the CommerceDelete operation. If the ReturnDeletedCount property is True, the total number of items deleted by the operation will be returned in the response.

CommerceQueryOptions

Applies to CommerceQuery and CommerceQueryRelatedItem operations. The IsRecursive property indicates whether child entities should be recursively loaded.

CommerceUpdateOptions

Applies to the CommerceUpdate operations.

PropertyDescription
ReturnModelThis property indicates which properties of the entity uploaded should be returned in the response. If this property is Null, the entity updated will not be returned in the response.
ReturnModelQueriesThis property specifies the CommerceQueryRelatedItem operations that will be used to populate the relationships of the commerce entity returned in the response. If Return Model is Null, the ReturnModelQueries is ignored.

In This Section

See Also

Other Resources

Developing with the Multi-Channel Commerce Foundation