Share via


DynamicCatalogSet Class

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

The DynamicCatalogSet class is used to manage a DynamicCatalogSet.

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

Syntax

'Declaration
Public Class DynamicCatalogSet _
    Inherits CatalogSet
'Usage
Dim instance As DynamicCatalogSet
public class DynamicCatalogSet : CatalogSet
public ref class DynamicCatalogSet : public CatalogSet
public class DynamicCatalogSet extends CatalogSet

Remarks

A DynamicCatalogSet is a catalog set which has an expression associated with it. All the product catalogs matching this expression are included in this catalog set.

Examples

// Creates a dynamic catalog set.
internal DynamicCatalogSet CreateDynamicCatalogSet(string catalogSetName, string description, string expression)
{
  try
  {
    // Create a catalog set
    DynamicCatalogSet catalogSet = this.catalogSetsContext.CreateDynamicCatalogSet(catalogSetName, description, expression);
    catalogSet.Description = "new Description";
    // Finally call save to save the cahnges to the catalog system
    catalogSet.Save();
    // Iterating the catalogs in the catalog set
    foreach (ProductCatalog productCatalog in catalogSet.IncludedCatalogs)
    {
      Console.WriteLine(productCatalog.Name);
    }
    // Iterating the catalogs not in the catalog set
    foreach (ProductCatalog productCatalog in catalogSet.NotIncludedCatalogs)
    {
      Console.WriteLine(productCatalog.Name);
    }
    return catalogSet;
  }
  catch (EntityAlreadyExistsException ex)
  {
    Console.WriteLine(ex.Message);
    throw;
  }
} 

Inheritance Hierarchy

System..::.Object
  Microsoft.CommerceServer.Catalog..::.CatalogObjectBase
    Microsoft.CommerceServer.Catalog..::.CatalogObject
      Microsoft.CommerceServer.CatalogSets..::.CatalogSet
        Microsoft.CommerceServer.CatalogSets..::.DynamicCatalogSet

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

DynamicCatalogSet Members

Microsoft.CommerceServer.CatalogSets Namespace