PromotionCollection.AddPromotion Method (String, Context)
Creates a promotion and adds it to the collection.
Namespace: Microsoft.SharePoint.Search.Extended.Administration.Keywords
Assembly: Microsoft.SharePoint.Search.Extended.Administration (in Microsoft.SharePoint.Search.Extended.Administration.dll)
Syntax
'Declaration
Function AddPromotion ( _
name As String, _
context As Context _
) As Promotion
'Usage
Dim instance As PromotionCollection
Dim name As String
Dim context As Context
Dim returnValue As Promotion
returnValue = instance.AddPromotion(name, _
context)
Promotion AddPromotion(
string name,
Context context
)
Parameters
name
Type: System.StringThe name to give the promotion.
context
Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.ContextThe context to associate with the promotion.
Return Value
Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.Promotion
A Promotion representing the added promotion.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The [name] is [null]. |
AdminException | The add operation.fails. An example of an add operation that will fail is adding an already existing promotion to the collection. |
See Also
Reference
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace