0
改变了我创建的内容项目的情况如下:果园CMS内容项目的类型不能以编程
ContentItem ci = _orchardServices.ContentManager.New("ContentTypeA");
_orchardServices.ContentManager.Create(ci, VersionOptions.Published);
ci.As<SomeContentPart>().SomeAttr = value;
...
_orchardServices.ContentManager.Publish(ci);
在另一种方法,我需要改变它的内容类型,我尝试没有成功如下:
ci.TypeDefinition = _contentDefinitionManager.GetTypeDefinition("ContentTypeB");
ci.ContentType = "ContentTypeB";
当我再次查询内容项目时,其内容类型仍然是“ContentTypeA”而不是“ContentTypeB”。
任何想法?
谢谢伯特兰。我正在将Sharepoint文档导入Orchard。因此,每次Sharepoint文档的内容类型发生更改时,都需要重新创建内容项目。对我来说看起来有点不整洁:S。我知道这个功能并不是高优先级的,但是可以使用它。 – sebasuy 2013-05-15 12:58:43