London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
EPiServer Commerce provides two order events for integration purposes so actions can be taken during these events. These events are synchronous, Therefore it is important for the actions to be quick, or be done in an asynchronous manner, so the event can return while the action does its work.
[ModuleDependency(typeof(EPiServer.Commerce.Initialization.InitializationModule))]
public class OrderEventInitialization : IConfigurableModule
{
public void Initialize(InitializationEngine context)
{
OrderContext.Current.OrderGroupUpdated += Current_OrderGroupUpdated;
OrderContext.Current.OrderGroupDeleted += Current_OrderGroupUpdated;
}
private void Current_OrderGroupUpdated(object sender, OrderGroupEventArgs e)
{
Task.Run(()=> DoSomething(sender as OrderGroup, e));
}
private void DoSomething(OrderGroup order, OrderGroupEventArgs e)
{
}
}
Last updated: May 25, 2015