我正在尝试保存我的IContent
被调用child
,但在这一行(contentService.SaveAndPublish(child);
)上我收到以下错误:Object reference not set to an instance of an object.
if (child.HasProperty("navn"))
{
child.SetValue("navn", worker.Name.ToString(), "da-dk");
}
contentService.SaveAndPublish(child);
这就是我定义我的方式contentService
:IContentService contentService = Umbraco.Core.Composing.Current.Services.ContentService;
我发现孩子是这样的:
long totalChildren;
IEnumerable<IContent> children = contentService.GetPagedChildren(filialsParent.Id, 0, 100, out totalChildren);
' 有人能指出这里有什么问题吗?