I have two list objects, say List
class PDTO
{
public string Prop1{get; set;}
}
class UPDTO
{
public PDTO oPDTO {get; set;}
}
I have data in List
We can do the same like the below:
foreach (PDTO oPDTO1 in oListPDTO)
{
oListUPDTO.Add(new UPDTO() { oPDTO = oPDTO1 });
}
Is there any better way of doing this?
Thanks,
Mukesh KV
VulpesPosted Aug 1, 2011, 4:08 AM
VulpesPosted Aug 1, 2011, 7:46 AM
However, using Select to do the conversions works fine and an explicit, rather than an implicit, conversion then suffices. So, it's still quite a neat approach.
mukesh kvPosted Aug 1, 2011, 5:48 AM
mukesh kvPosted Aug 1, 2011, 5:45 AM
Zoran HorvatPosted Aug 1, 2011, 4:15 AM
Zoran