Created
July 10, 2013 14:33
-
-
Save drift/5966804 to your computer and use it in GitHub Desktop.
Umbraco v6 change document type of a node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Umbraco.Core.Models; | |
@using Umbraco.Core.Services; | |
var contentService = ApplicationContext.Current.Services.ContentService; | |
var contentTypeService = ApplicationContext.Current.Services.ContentTypeService; | |
var contentType = contentTypeService.GetContentType(4200); | |
var content = contentService.GetById(2052); | |
content.ChangeContentType(contentType); | |
contentService.Save(content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment