Class PromotionInfoExtensions
Extension methods for PromotionInfo.
public static class PromotionInfoExtensions
- Inheritance
-
objectPromotionInfoExtensions
Methods
GetPromotionRuleProperties<TPromotionRuleProperties>(PromotionInfo)
Gets the promotion rule properties by deserializing the stored JSON properties from the promotion info.
public static TPromotionRuleProperties GetPromotionRuleProperties<TPromotionRuleProperties>(this PromotionInfo promotionInfo) where TPromotionRuleProperties : IPromotionRuleProperties
Parameters
promotionInfoPromotionInfoThe promotion info instance.
Returns
- TPromotionRuleProperties
The deserialized promotion rule properties of type
TPromotionRuleProperties, ornullif the configuration is not available or cannot be deserialized.
Type Parameters
TPromotionRulePropertiesThe type of the promotion rule properties to deserialize, which must implement IPromotionRuleProperties.
Exceptions
- ArgumentNullException
Thrown when
promotionInfoisnull.
SetPromotionRuleProperties<TPromotionRuleProperties>(PromotionInfo, TPromotionRuleProperties)
Sets the promotion rule properties by serializing the configuration object to JSON and storing it.
public static void SetPromotionRuleProperties<TPromotionRuleProperties>(this PromotionInfo promotionInfo, TPromotionRuleProperties properties) where TPromotionRuleProperties : IPromotionRuleProperties
Parameters
promotionInfoPromotionInfoThe promotion info instance.
propertiesTPromotionRulePropertiesThe promotion rule properties object to serialize and store.
Type Parameters
TPromotionRulePropertiesThe type of the promotion rule properties, which must implement IPromotionRuleProperties.
Exceptions
- ArgumentNullException
Thrown when
promotionInfoorpropertiesisnull.