如何检查节点是否是新节点,我只希望在保存新节点时创建组件,使用 Umbraco 8
ContentService.Saved += this.ContentService_Saved;
private void ContentService_Saved(IContentService sender, ContentSavedEventArgs e)
{
foreach (var node in e.SavedEntities)
{
if (node.ContentType.Alias == "basePage")
{
var childnode = sender.Create("Components", node.Id, "components");
sender.Save(childnode, raiseEvents: false);
}
}
}