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
Kiran Thakur
NA
569
548.6k
Convert single class to complex class
Aug 12 2016 9:48 PM
Hi,
I am facing a issue, I have a class called
Question
and i want to write a converter
Question
to
Subject
. How can i write a converter. Conversion happen on dynamic not static.
Input class
public class Question
{
public int SubjectId { get; set; }
public string SubjectName { get; set; }
public int SubjectOrder { get; set; }
public string SubjectDescription { get; set; }
public int QuestionId { get; set; }
public string QuestionName { get; set; }
public int QuestionOrder { get; set; }
public string QuestionDescription { get; set; }
}
Output Class
public class Subject {
public int SubjectId { get; set; }
public string SubjectName { get; set; }
public int SubjectOrder { get; set; }
public string SubjectDescription { get; set; }
public List<QuestionDetail> QuestionDetails { get; set; }
}
public class QuestionDetail {
public int QuestionId { get; set; }
public string QuestionName { get; set; }
public int QuestionOrder { get; set; }
public string QuestionDescription { get; set; }
}
How can i do that. Please help me.
Reply
Answers (
2
)
Not able to do POST request to webAPI
how to save console output data into excel file using c#