I use registerclassmap
to map values with CSVReader, like below:
AppSettings settings;
...
csvReader.Configuration.RegisterClassMap<EmployeeMapping>();
How to pass the settings instance to use it in the EmployeeMappaing
instance created by CSVReader?
Are you looking to do something like this? You can create the EmployeeMapping
instance yourself rather than have RegisterClassMap
create the instance.
AppSettings settings;
...
csvReader.Configuration.RegisterClassMap(new EmployeeMapping(settings));