TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mukesh kv
NA
16
0
Copy list object into object of another list object
Aug 1 2011 3:49 AM
Hi all,
I have two list objects, say List<UPDTO> and List<PDTO>
class PDTO
{
public string Prop1{get; set;}
}
class UPDTO
{
public PDTO oPDTO {get; set;}
}
I have data in List<PDTO>. And I want this to get copied to the object (PDTO) that I have in List<UPDTO>. Could you please let me know the solution?
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
Reply
Answers (
5
)
Error in web.config fig
Application throws error