CreateFromCache Method (CommerceCache)
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
Creates a DiscountItemCollection from the specified Cache.
Namespace: Microsoft.CommerceServer.Runtime.Marketing
Assembly: Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)
Syntax
'Declaration
Public Shared Function CreateFromCache ( _
cache As CommerceCache _
) As DiscountItemCollection
'Usage
Dim cache As CommerceCache
Dim returnValue As DiscountItemCollection
returnValue = DiscountItemCollection.CreateFromCache(cache)
public static DiscountItemCollection CreateFromCache(
CommerceCache cache
)
public:
static DiscountItemCollection^ CreateFromCache(
CommerceCache^ cache
)
public static function CreateFromCache(
cache : CommerceCache
) : DiscountItemCollection
Parameters
- cache
Type: Microsoft.CommerceServer.Runtime.Caching..::.CommerceCache
The cache to be used to created the collection. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
Return Value
Type: Microsoft.CommerceServer.Runtime.Marketing..::.DiscountItemCollection
A DiscountItemCollection object corresponding to the cache.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | cache is nullNothingnullptra null reference (Nothing in Visual Basic). |
Remarks
Creates a DiscountItemCollection from the specified CommerceCache.
The DiscountItemCollection contains all discounts that meet all of the following criteria:
The parent customer of the discount is not deleted or archived.
The parent campaign of the discount is not deleted or archived.
The parent campaign of the discount is active.
The discount is not deleted or archived.
The discount is active.
The discount has started or will start within one week.
The discount has not ended, or the discount has ended within the past month.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.