Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoMap / RegisterClassMap missing from original library? #14

Open
adamreed90 opened this issue Apr 30, 2021 · 1 comment
Open

AutoMap / RegisterClassMap missing from original library? #14

adamreed90 opened this issue Apr 30, 2021 · 1 comment

Comments

@adamreed90
Copy link

adamreed90 commented Apr 30, 2021

This was possible with original library:

 using (var workbook = new XLWorkbook(XLEventTracking.Disabled))
            {
                var report = workbook.AddWorksheet("Report");
                using (var csv = new CsvWriter(new ExcelSerializer(report)))
                {
                    csv.Configuration.RegisterClassMap<BrightMaps.BatchReportMap>();
                    csv.WriteRecords(output);
                }
                workbook.SaveAs(office.ReportFolder + "\\" + fileName);
            }
            

Did this get moved/renamed?

@Ben52
Copy link

Ben52 commented Jan 27, 2022

In case anyone is looking for the answer to this, its on the Context now, not Configuration. So you should be able to do csv.Context.RegisterClassMap<BrightMaps.BatchReportMap>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants