'IPublishedContent' does not contain a definition for 'GetPropertyValue'
Hi guys! Really hoping someone can help me. I'm pretty pleased with myself that this is the first time I've had to admit defeat and look to you lovely folks for help!
I'm building a news and events listing page in Umbraco 8, and allllllll I need to do is filter the results by my Umbraco.DropDown.Flexible doctype.
Here is my nice simple query...
IEnumerable
But no matter what I simply get 'IPublishedContent' does not contain a definition for 'GetPropertyValue' back from the compiler.
I've searched and checked the namespaces everyone else seems to suggest this might need (though these are in my View web.config anyway so even more confused), and to no avail.
I've a feeling it's something incredibly simple, so if some kind person would like to kindly point it out (without laughing :) ) I'd be very grateful.
The syntax for working with IPublishedContent has changed in V8 (to hopefully make it simpler to work with), and you are correct to have discovered that the new equivalent of GetPropertyValue() is Value().
(which is less to type, although I still type 'GetPropertyValue' first then have to delete it, and type Value... so in a way 'more' to type :-P)
Because they are really similar but different, and referenced everywhere in the documentation, it's still very much a work in progress to update the docs for V8 - but if you could create an issue here: https://github.com/umbraco/UmbracoDocs/issues for where you found the docs were out of date and contradictory, then somebody in the community can provide a PR to update them for future GetPropertyValuers... or you could update the example yourself and gain the 'much-coveted' C-Trib badge for your profile...
'IPublishedContent' does not contain a definition for 'GetPropertyValue'
Hi guys! Really hoping someone can help me. I'm pretty pleased with myself that this is the first time I've had to admit defeat and look to you lovely folks for help! I'm building a news and events listing page in Umbraco 8, and allllllll I need to do is filter the results by my Umbraco.DropDown.Flexible doctype.
Here is my nice simple query...
IEnumerable
But no matter what I simply get 'IPublishedContent' does not contain a definition for 'GetPropertyValue' back from the compiler.
I've searched and checked the namespaces everyone else seems to suggest this might need (though these are in my View web.config anyway so even more confused), and to no avail.
I've a feeling it's something incredibly simple, so if some kind person would like to kindly point it out (without laughing :) ) I'd be very grateful.
Thank you !
For anyone else finding this thread, the code works just fine if I use .Value instead of GetPropertyValue (even when querying).
This contradicts the documentation, so if anyone would like to explain why, I'd be very grateful :)
Thanks all.
Hi Rowena
The syntax for working with IPublishedContent has changed in V8 (to hopefully make it simpler to work with), and you are correct to have discovered that the new equivalent of GetPropertyValue() is Value().
https://our.umbraco.com/Documentation/Reference/Querying/IPublishedContent/Properties/#modelvaluestring
(which is less to type, although I still type 'GetPropertyValue' first then have to delete it, and type Value... so in a way 'more' to type :-P)
Because they are really similar but different, and referenced everywhere in the documentation, it's still very much a work in progress to update the docs for V8 - but if you could create an issue here: https://github.com/umbraco/UmbracoDocs/issues for where you found the docs were out of date and contradictory, then somebody in the community can provide a PR to update them for future GetPropertyValuers... or you could update the example yourself and gain the 'much-coveted' C-Trib badge for your profile...
regards
Marc
Thanks Marc, even after a rather frustrating Monday I'm at least reassured to know I wasn't going mad :)
I'll raise the issue this week to save someone else's hair going grey.
Thanks again for getting back to me so quickly - the community makes up for the documentation work in progress!
Rowena
Hey,
Hope you identify the mistake, anyway, In v8 GetPropertyValue is Replaced with Value()
Thanks D K M J!
is working on a reply...