/wp-handle-document-events-differently-with-udocumenteventhandler-01.cs
Created Nov 10, 2018
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