I tried that, but it only becomes null, my code was this:
private void RemoteInventoryUpdated(object sender, InventoryUpdateEventArgs inventoryUpdatedEventArgs)
{
var inventory = sender as IEnumerable<InventoryRecord>;
//do stuffs
}
I'm not entirely sure but when you listen to a remote event, the sender is not "transmitted".
In future version of Commerce, the args will contain the delta changes to the inventory system.
I see, do you know if there is another way to find the delta from within the event-hook?
Unfortunately no, it needs changes in the core, so it requires newer version from us. As always, it's good thing to keep up to date https://vimvq1987.com/why-you-should-upgrade-to-the-latest-version/
Quan - since requesting inventory via the IInventoryService in the event hook will return the "old" inventory records, does that mean that there's no way to get the updated inventory status on the same request? Any suggestion for a work around for this?
Hello,
I have implemented the InventoryUpdated event as described here: https://world.episerver.com/documentation/developer-guides/commerce/events/inventory-events/
The events are raised as expected, however i need to know what the update to the inventory was.
If i understand the documentation correctly, it seems this information should be in the sender object, however i do not see any usefull information on the object when i debug it. Is there some casting or transformation necessary and if so how do i do that?
I use Commerce version 11.8.1
/jon