Class Ecommerce.Product.BeforeDeleteArgs
- Namespace
- Dynamicweb.Ecommerce.Notifications
- Assembly
- Dynamicweb.Ecommerce.dll
Provides information about product before deleting it.
public class Ecommerce.Product.BeforeDeleteArgs : NotificationArgs
- Inheritance
-
Ecommerce.Product.BeforeDeleteArgs
- Inherited Members
Examples
using static Dynamicweb.Ecommerce.Notifications.Ecommerce.Product;
using Dynamicweb.Extensibility.Notifications;
namespace Dynamicweb.Ecommerce.Examples.Notifications;
[Subscribe(BeforeDelete)]
public class EcomProductBeforeDeleteObserver : NotificationSubscriber
{
public override void OnNotify(string notification, NotificationArgs args)
{
if (args is not BeforeDeleteArgs beforeDeleteArgs)
return;
// Add code here
}
}
Remarks
The passed NotificationArgs is Ecommerce.Product.BeforeDeleteArgs
Constructors
BeforeDeleteArgs(Product)
Initializes a new instance of the Ecommerce.Product.BeforeDeleteArgs class.
public BeforeDeleteArgs(Product product)
Parameters
productProductThe product.
BeforeDeleteArgs(ProductCollection)
Initializes a new instance of the Ecommerce.Product.BeforeDeleteArgs class.
public BeforeDeleteArgs(ProductCollection products)
Parameters
productsProductCollectionThe products.
BeforeDeleteArgs(string, string, string)
Initializes a new instance of the Ecommerce.Product.BeforeDeleteArgs class.
public BeforeDeleteArgs(string productId, string productVariantId, string productLanguageId)
Parameters
productIdstringThe product Id.
productVariantIdstringThe product variant Id.
productLanguageIdstringThe product language Id.
Properties
ExecutingContext
Gets the executing context.
public Ecommerce.Product.ExecutingContext ExecutingContext { get; }
Property Value
- Ecommerce.Product.ExecutingContext
The executing context.
IsCleanUp
Gets a value indicating whether all additional information pertaining to the product is deleted.
public bool IsCleanUp { get; }
Property Value
- bool
trueif all information is deleted; otherwise,false.
Product
Gets the product. Will return null is ExecutingContext is not SingleProduct.
public Product Product { get; }
Property Value
- Product
The product.
ProductCollection
Gets the product collection. Will return null if ExecutingContext is not ProductCollection.
public ProductCollection ProductCollection { get; }
Property Value
- ProductCollection
The product collection.
ProductId
Gets the product Id. Will return null if ExecutingContext is not SingleProduct.
public string ProductId { get; }
Property Value
- string
The product identifier.
ProductLanguageId
Gets the product language Id. Will return null if ExecutingContext is not SingleProduct.
public string ProductLanguageId { get; }
Property Value
- string
The product language identifier.
ProductVariantId
Gets the product variant Id. Will return null if ExecutingContext is not SingleProduct.
public string ProductVariantId { get; }
Property Value
- string
The product variant identifier.
StopExecution
Gets or sets a value indicating whether to stop the delete process. If true then the delete process is interrupted.
public bool StopExecution { get; set; }
Property Value
- bool
trueif delete process should be interrupted; otherwise,false.