我正在尝试以编程方式克隆内容项。内置clone()
方法还不够,我需要干预部分过程。我尝试克隆的内容项具有类别分类字段。我希望我可以按照以下方式做一些事情:
var sourceContentItemCategory = sourceContentItem.ContentItem.Category as TaxonomyField;
var targetContentItemCategory = targetContentItem.ContentItem.Category as TaxonomyField;
targetContentItemCategory.Terms = sourceContentItemCategory.Terms;
但我明白为什么这不起作用。术语是只读的,如果我没记错的话,每个术语也是它自己的内容项,所以我不能只是将这些东西批发到另一个分类法中。最简单的方法是什么?TaxonomyService 可以帮助我做到这一点吗?