Share via


Create Method (CatalogSiteAgent)

Creates an instance of the CatalogContext object from the specified site agent.

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

Syntax

'Declaration
Public Shared Function Create ( _
    catalogSiteAgent As CatalogSiteAgent _
) As CatalogContext
'Usage
Dim catalogSiteAgent As CatalogSiteAgent
Dim returnValue As CatalogContext

returnValue = CatalogContext.Create(catalogSiteAgent)
public static CatalogContext Create(
    CatalogSiteAgent catalogSiteAgent
)
public:
static CatalogContext^ Create(
    CatalogSiteAgent^ catalogSiteAgent
)
public static function Create(
    catalogSiteAgent : CatalogSiteAgent
) : CatalogContext

Parameters

Return Value

Type: Microsoft.CommerceServer.Catalog..::.CatalogContext
An instance of the CatalogContext object.

Remarks

The CatalogContext class contains the functionality to manage the catalog and inventory systems.

Examples

This example creates a CatalogContext object.

public static void CreateCatalogContext()
{   
    // Create a CatalogSiteAgent to connect to the database.
    CatalogSiteAgent catalogSiteAgent = new CatalogSiteAgent();
    catalogSiteAgent.SiteName = "CSharpSite";

    // Create a CatalogContext.
    CatalogContext context = CatalogContext.Create(catalogSiteAgent);
}

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

Create Overload

Microsoft.CommerceServer.Catalog Namespace

Other Resources

How to Create a CatalogContext Object