I have an entity like this:
public class Task
{
public string TaskID { get; set; }
public string Description { get; set; }
public string IsComplete { get; set; }
}
I have a collection of Tasks like:
List<Task> tasks = new List<Task>();
tasks.Add(new Task() { TaskID = "1", Description = "A", IsComplete = "Yes" });
tasks.Add(new Task() { TaskID = "2", Description = "B", IsComplete = "No" });
I am trying to get the following delimited string from this collection:
1#Yes,2#No
I've managed to get as far as:
string delimitedString = String.Join(",", tasks.ToList().Select(l => l.TaskID));
...How do I further select and separate additional fields?