Share via


GetDefinitions Method (CatalogDefinitionType)

Returns a CatalogDefinitionsDataSet containing all the definitions in the catalog system that match the definition type.

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

Syntax

'Declaration
Public Function GetDefinitions ( _
    definitionType As CatalogDefinitionType _
) As CatalogDefinitionsDataSet
'Usage
Dim instance As CatalogContext
Dim definitionType As CatalogDefinitionType
Dim returnValue As CatalogDefinitionsDataSet

returnValue = instance.GetDefinitions(definitionType)
public CatalogDefinitionsDataSet GetDefinitions(
    CatalogDefinitionType definitionType
)
public:
CatalogDefinitionsDataSet^ GetDefinitions(
    CatalogDefinitionType definitionType
)
public function GetDefinitions(
    definitionType : CatalogDefinitionType
) : CatalogDefinitionsDataSet

Parameters

Return Value

Type: Microsoft.CommerceServer.Catalog..::.CatalogDefinitionsDataSet
A CatalogDefinitionsDataSet containing all the definitions in the catalog system that match the definitionType.

Remarks

This method returns the category and/or product definitions in the catalog system that match the search clause specified by definitionType. If definitionType is nullNothingnullptra null reference (Nothing in Visual Basic) then this method returns all the definitions in the catalog system. Any columns used in the search clause should be surrounded by square brackets. Any string values referenced in the search clause should be prefixed by N to allow searching unicode data. example string searchClause = @"\[DefinitionName\] LIKE N'%MyDefinition%'"; You can also specify multiple conditions in the search clause by using valid SQL operators. example string searchClause = @"\[DefinitionName\] LIKE N'%MyDefinition%' OR \[DefinitionType\]=1";

Examples

This example describes how to retrieve the definitions beginning with 'Category' in the catalog system and access the properties on the CatalogDefinitionsDataSet object.

using System;
using Microsoft.CommerceServer.Catalog;
private void GetDefinitions(CatalogContext catalogContext)
{
  string searchClause = @"[DefinitionName] LIKE N'%Category%'";
  CatalogDefinitionsDataSet catalogDefinitions = catalogContext.GetDefinitions(searchClause);
  foreach(CatalogDefinitionsDataSet.CatalogDefinition catalogDefinition in catalogDefinitions.CatalogDefinitions)
  {
    string definitionName = catalogDefinition.DefinitionName;
    CatalogDefinitionType catalogDefinitionType = (CatalogDefinitionType)catalogDefinition.DefinitionType;
    string userDefinedDefinitionAttribute = (string)catalogDefinition["UserDefinedDefinitionAttributeName"];
  }
}

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

GetDefinitions Overload

Microsoft.CommerceServer.Catalog Namespace