Share via


Commerce Foundation Site CommerceQuery

Use the model search query to retrieve the Site commerce entity with its related catalogs.

Syntax

        var querySite = new CommerceQuery<CommerceEntity>("Site");
      

Parameters

Parameter

Description

SearchCiteria.ModelName

Only site is permissible. The system throws an exception if you specify another type.

SearchCiteria.Model.Id

Not required since there is only one site per channel. If, however, an ID is specified that does not equal the current channel's ID, for example, the site name, the system throws an exception.

SearchCiteria.ReturnTotalItemCount

If True, populates the CommerceResponse.TotalItemCount.

Operation Sequence Components

Operation Sequence Component

Description

SiteLoader

Runs the search for catalog(s) and caches the result(s). Model search only.

SiteCatalogsProcessor

Retrieves the child catalogs from Commerce Server for the site. Model search only.

Related Operation

Description

CommerceQueryRelatedItem<Catalog> (Catalogs)

Retrieves catalog information that the site uses.

Property

Description

CommerceRelatedOperations type(s)

Only evaluates CommerceQueryRelatedItem.

CommerceQueryRelatedItem.RelatedOperations

Only evaluates relationships with Catalogs relationship name.

CommerceQueryRelatedItem.SearchCriteria.FirstItemIndex

Valid.

CommerceQueryRelatedItem.SearchCriteria.NumberOfItemsToReturn

Valid.

CommerceQueryRelatedItem.SearchCriteria.ReturnTotalItemCount

Valid. If True, populates the Catalogs.TotalItemCount.

CommerceQueryRelatedItem.SearchCriteria.WhereClause

Valid.

CommerceQueryRelatedItem.SearchCriteria.Model.Id

This is the ID of the Commerce Server site to retrieve.

Return Value

This query returns the Site object with its related catalogs.

Exceptions

Microsoft Multi-Channel Commerce Foundation can throw the following exception during this operation:

  • FaultException<GeneralOperationFault>

See Also

Other Resources

Commerce Foundation Site

CommerceQuery