asp.net mvc 4 - Orchard CMS content item's type could not be changed programmatically -


i created content item's instance follows:

contentitem ci = _orchardservices.contentmanager.new("contenttypea"); _orchardservices.contentmanager.create(ci, versionoptions.published); ci.as<somecontentpart>().someattr = value; ... _orchardservices.contentmanager.publish(ci); 

in method need change it's content type, , tried following without success:

ci.typedefinition = _contentdefinitionmanager.gettypedefinition("contenttypeb"); ci.contenttype = "contenttypeb"; 

when query content item again, content type still "contenttypea" instead of "contenttypeb".

any ideas?

once content item has been created, can't change content type. well, in theory hack database , make work, seems better use of time create new item , copy data.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -