S
shapper
Hello,
I want to create a List(Of Tag) where Tag is an object with two
properties: ID and Name
I am creating this list from a CSV string that contains names of many
Tags.
So I create the List, giving to each Tag only its name (the ID remains
empty, as follows:
List<Tag> form = paper.Tags.Split(',').Select(p => new Tag { Name =
p.Trim() }).ToList();
What happens is that if the CSV is empty I still get one Tag in the
list with Name = "".
What am I doing wrong?
Thanks,
Miguel
I want to create a List(Of Tag) where Tag is an object with two
properties: ID and Name
I am creating this list from a CSV string that contains names of many
Tags.
So I create the List, giving to each Tag only its name (the ID remains
empty, as follows:
List<Tag> form = paper.Tags.Split(',').Select(p => new Tag { Name =
p.Trim() }).ToList();
What happens is that if the CSV is empty I still get one Tag in the
list with Name = "".
What am I doing wrong?
Thanks,
Miguel