Export Complex Class Structure Into CSV with CSVHelper #1420
Unanswered
rakeshmahur
asked this question in
Q&A
Replies: 1 comment
-
You can do this with a class map. public class PersonalDetailsMIMap : ClassMap<PersonalDetailsMI>
{
public PersonalDetailsMIMap()
{
Map(m => m.PrimaryCustomer.Name.FirstName).Name("PrimaryCustomer_FirstName");
Map(m => m.PrimaryCustomer.Name.LastName).Name("PrimaryCustomer_LastName");
Map(m => m.SecondryCustomer.Name.FirstName).Name("SecondryCustomer_FirstName");
Map(m => m.SecondryCustomer.Name.LastName).Name("SecondryCustomer_LastName");
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i have nested class structure and want to export csv file with header name.
Expected Csv Format:
currently i am able to export like this.
can you please help me to resolve this.
Beta Was this translation helpful? Give feedback.
All reactions