Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 4 Orchard CMS内容项';无法以编程方式更改的类型_Asp.net Mvc 4_Orchardcms - Fatal编程技术网

Asp.net mvc 4 Orchard CMS内容项';无法以编程方式更改的类型

Asp.net mvc 4 Orchard CMS内容项';无法以编程方式更改的类型,asp.net-mvc-4,orchardcms,Asp.net Mvc 4,Orchardcms,我创建了一个内容项的实例,如下所示: ContentItem ci = _orchardServices.ContentManager.New("ContentTypeA"); _orchardServices.ContentManager.Create(ci, VersionOptions.Published); ci.As<SomeContentPart>().SomeAttr = value; ... _orchardServices.ContentManager.Publis

我创建了一个内容项的实例,如下所示:

ContentItem ci = _orchardServices.ContentManager.New("ContentTypeA");
_orchardServices.ContentManager.Create(ci, VersionOptions.Published);
ci.As<SomeContentPart>().SomeAttr = value;
...
_orchardServices.ContentManager.Publish(ci);
当我再次查询内容项时,其内容类型仍然是“ContentTypeA”,而不是“ContentTypeB”


有什么想法吗?

一旦创建了内容项,就不能更改其内容类型。从理论上讲,你可以侵入数据库并使其正常工作,但创建一个新项目并复制数据似乎能更好地利用你的时间。

谢谢Bertrand。我正在将Sharepoint文档导入Orchard。因此,每次更改Sharepoint文档的内容类型时,我都需要重新创建内容项。对我来说似乎有点不整洁:S。我知道这个功能不是高优先级的,但如果它可用就好了。
ci.TypeDefinition = _contentDefinitionManager.GetTypeDefinition("ContentTypeB");
ci.ContentType = "ContentTypeB";