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)
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?
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:
Get raw value instead of the converted value
Hello,
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)
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?
Jeroen
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:
Thanks. It works perfect!
Yes exactly what Dan says.
is working on a reply...