S
shapper
Hello,
I have a class, Article, with 2 properties: List<Tag> Tags and String
TagsCsv.
I am using the following to fill TagsCsv from Tags list:
MyArticle.TagsCsv = String.Join(", ", MyArticle.Tags.Select(t =>
t.Name).ToArray());
However, I have now a list of articles: List<Article> Articles to
which I want to apply the same rule (Tags to TagsCsv conversion) to
each article on that list.
How can I do this?
And is this possible to do with Linq instead of a loop?
Thanks,
Miguel
I have a class, Article, with 2 properties: List<Tag> Tags and String
TagsCsv.
I am using the following to fill TagsCsv from Tags list:
MyArticle.TagsCsv = String.Join(", ", MyArticle.Tags.Select(t =>
t.Name).ToArray());
However, I have now a list of articles: List<Article> Articles to
which I want to apply the same rule (Tags to TagsCsv conversion) to
each article on that list.
How can I do this?
And is this possible to do with Linq instead of a loop?
Thanks,
Miguel