I have the following class:
class Item
{
public string[] field1;
public int field2;
}
Well i have collection of items. How can i convert these collection to
class Item
{
public string field1;
public int field2;
}
I mean something like Items.SelectMany(x => x.field1) but i need to save filed2 value for each element of my collection.
example
field1:{"asd","asdf","fscsd"}
field2:123
->
field1:{"asd"}
field2:123
field1:{"asdf"}
field2:123
field1:{"fscsd"}
field2:123
Try this:
You will get back an enumerable of anonymous objects, each with two fields –
field1andfield2.