I have the same issue inside UmbracoApiController.
Furthermore I noticed there isn't any SaveAndPublish method like when using ContentService inside a razor file inherited from Umbraco.Web.Mvc.UmbracoTemplatePage, but it has a SaveAndPublishWithStatus method.
In razor template it used ContentService from ApplicationContext.Current.Services.ContentService, in WebApi controller just from Services.ContentService
I can access the SetValue method via IntelliSense, but it seems to fail it this case. It works if I use the following instead:
Umbraco.Core.Models.IContent Does not contain a definition for SetValue
In my controller i am trying to update a node like this
this works fine.
but when i get to
then i get the error
Umbraco.Core.Models.IContent Does not contain a definition for SetValue
Anyone know what the problem might be ?
I did some debugs and i can see that all information that is passed into the controller is correct
Figured it out, for some reason, SetValue cannot be used so instead i found i could use opdatereHold.Properties["holdNavn"].Value = clubTitle;
Could you figure out the problem with SetValue? I'm facing with the same issue.
The traditional method: opdatereHold.Properties["holdNavn"].Value = clubTitle; worked like a charm, but should we use this one instead of SetValue?
Im on the same road now :D
But did anyone find out what to use ?
I have the same issue inside UmbracoApiController. Furthermore I noticed there isn't any SaveAndPublish method like when using ContentService inside a razor file inherited from
Umbraco.Web.Mvc.UmbracoTemplatePage
, but it has a SaveAndPublishWithStatus method.In razor template it used ContentService from
ApplicationContext.Current.Services.ContentService
, in WebApi controller just fromServices.ContentService
I can access the SetValue method via IntelliSense, but it seems to fail it this case. It works if I use the following instead:
/Bjarne
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.