Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm using the Umbraco Core Property Value Converters. So for MNTP I always get the IEnumerable with IPublishedContent. I would like to only get the ids. I can't do the following: this.GetPropertyValue<IEnumerable<IPublishedContent>>("elements").Select(x => x.Id)
this.GetPropertyValue<IEnumerable<IPublishedContent>>("elements").Select(x => x.Id)
Because this will go through the converter which means they've already been converted to IPublishedContent and I don't want that because it's bad for performance.
Can I get the raw value for a specific property while not going through the converter?
Yep, you can do:
This will return the raw value. In the case of an MNTP it depends on the format of how you saved it, but usually this would be CSV so you can cast to string and then do a String.Split, something like:
this.GetProperty("elements").DataValue.ToString().Split(',').Select(n => Convert.ToInt32(n));
Thanks. It works perfect!
Yes exactly what Dan says.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted