I feel like I'm missing something super simple but is there a way to generate a csv from an Ienmerable without doing a foreach loop? I need to store the values of the names of nodes within the ienumberable into one var somehow.
So I have this which queries a MNTP
var industries = item.GetPropertyValue<IEnumerable<IPublishedContent>>("industries");
And the output I want is "industrynode1, industrynode2, etc"
I feel like that's close but its throwing this: CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.
That worked with the omission of Any(). Thank you both for your help. I'm going to try to format this for another use as a html class list like .industries-aerospace .industries-automotive but i think I can do that with some replace() statements.
Generate list from ienumberable
I feel like I'm missing something super simple but is there a way to generate a csv from an Ienmerable without doing a foreach loop? I need to store the values of the names of nodes within the ienumberable into one var somehow.
So I have this which queries a MNTP
And the output I want is "industrynode1, industrynode2, etc"
Thanks! Amir
Hi Amir,
Not tested, but maybe something like this.
I feel like that's close but its throwing this: CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.
Possibly this?
That worked with the omission of Any(). Thank you both for your help. I'm going to try to format this for another use as a html class list like .industries-aerospace .industries-automotive but i think I can do that with some replace() statements.
is working on a reply...