Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello,

i'm need to getting somes datas from a collections and parse to another collection.

C#
//*** TO THIS CLASSES ***//
public class Type0
{
   int GroupID {get; set;} 
   //other properties
   
}

public class Group0
{
   //other properties
}

/////////////FOR THIS CLASSES//////////
public class Type1
{
    
   //other properties
   
}

public class Group1
{
    List<Type1> collection {get;set;}
   //other properties
}


I have a Collection of 'Type0' and i need parse this collection to a collection 'Group1'.

How i can do this, using a linq expression?

thank you
Posted
Comments
SP HINGU 31-Jan-14 13:14pm    
can you please specify properties of Type1..?
EduChapow 3-Feb-14 14:25pm    
public int id {get;set;}
public string name {get;set}
Sergey Alexandrovich Kryukov 31-Jan-14 13:22pm    
First of all, why do you think a collection should be "parsed"? It is not text or something, isn't it? Do you mean that source collection had something potentially unstructured (as with text)? If it is, why? Or did you mean something else?
—SA
EduChapow 3-Feb-14 14:22pm    
Hello,
the (type0 and type1) and (group0 and group1) is similar, just changing your STRUCTURE, i just need to do transfer of properties values.
Sergey Alexandrovich Kryukov 3-Feb-14 15:05pm    
You did not answer my question...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900