score:0

Accepted answer

try formatting your output. something like below should work.

labels: @string.join(",", model.select(x => $"'{x.namearea}'"))

so basically what this is doing is instead of a foreach we are selecting just the name area from all of the models in your list. that select is also adding single quotes around your namearea using string interpolation. from there we are doing a join to comma delimit the list.

hopefully this works for you.


Related Query

More Query from same tag