Programmatic Recycle vs. Delete SF 7.1
Today, I looked into how to recycle content items from the Module Builder instead of delete them.
It would have been nice to see this in the generated API documentation for my content types, but I found this other documentation which got me part of the way.
www.sitefinity.com/.../sending-items-to-the-recycle-bin
The technique is almost the same as the news version above:
dynamicModuleManager.RecycleBin.MoveToRecycleBin(master);
So instead of just getting the data item and moving it to the recycle bin, you need to get the data item, get its master and then move the master.
Since the documentation is still a bit sparse, I thought I'd post this.
DynamicContent resourceItem = dynamicModuleManager.GetDataItem(resourceType, resourceID);
var master = dynamicModuleManager.Lifecycle.Edit(resourceItem) as DynamicContent;
if (master != null)
dynamicModuleManager.RecycleBin.MoveToRecycleBin(master);
Hi,
Thank you for sharing the code with the community. I will forward it to our documentation team.
Regards,
Stefani Tacheva
Telerik