I have a simple class:
public class Item
{
public int A {get; set;}
public int B {get; set;}
}
Let's say that I have a collection of Items:
var items = new List<Item>
{
new Item { A = 1, B = 2},
new Item { A = 3, B = 4}
};
What I need is a LINQ query to cast each Item object values into string array, so that for example above I will get:
IEnumerable<string []> result = {
{"1", "2"}, // First Item
{"3", "4"} // Second Item
}
Any ideas how to acomplish that?