This in turn calls this method, which was written by someone else, and causes our application to hang.
Here is a snippet of the method (which is a static method btw):
var oldCustomer = e.MoveInfoCollection.FirstOrDefault(x => x.Entity.ContentType.Alias == "Customerpage");
if (oldCustomer != null)
{
// Delete role
var roleName = oldCustomer.Entity.Name;
var existing =
ApplicationContext.Current.Services.MemberService.GetAllRoles().FirstOrDefault(x => x == roleName);
if (existing != null)
{
ApplicationContext.Current.Services.MemberService.DeleteRole(roleName, true);
}
return;
}
Is it a better way to do this than dragging in the memberservice (and then the same for media) to delete related content?
Should this be moved to some kind of scheduled task?
Accessing services in events (e.g. Trashing)
I have registered a method to the ContentService.Trashing event with:
This in turn calls this method, which was written by someone else, and causes our application to hang. Here is a snippet of the method (which is a static method btw):
Is it a better way to do this than dragging in the memberservice (and then the same for media) to delete related content?
Should this be moved to some kind of scheduled task?
Regards, Hans B
is working on a reply...