Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/32f9142a68e3d44691e5e85fd08472d1 to your computer and use it in GitHub Desktop.
Save ssougnez/32f9142a68e3d44691e5e85fd08472d1 to your computer and use it in GitHub Desktop.
public class DocumentEventHandlerRegistration : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
ContentService.Saving += ContentService_Saving;
}
private void ContentService_Saving(IContentService sender, SaveEventArgs<IContent> e)
{
if (e.SavedEntities.FirstOrDefault().ContentType.Alias == "documentTypeA")
{
// Do stuff
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment