Created
July 13, 2015 12:25
-
-
Save nul800sebastiaan/a640b1bbf4b7e3c1a1fa to your computer and use it in GitHub Desktop.
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
var contentService = UmbracoContext.Application.Services.ContentService; | |
var content = contentService.GetById(Model.Content.Id); | |
var currentValue = content.GetValue<bool>("myProp"); | |
content.SetValue("myProp", !currentValue); | |
contentService.SaveAndPublishWithStatus(content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment