EPPlus.DataExtractor icon indicating copy to clipboard operation
EPPlus.DataExtractor copied to clipboard

WithPropertyHeader: extract data by header text instead of column name

Open imil opened this issue 7 years ago • 0 comments

A feature that was convenient to me, and might be useful for others: Instead of searching for the property by column name, search by the header text. Example:

| A | B 1| Product | Price 2| Tea | 0.9 3| Coffee | 1.5

Instead of writing .WithProperty(p=>p.Price, "B") it will be possible to write .WithHeaderRow(1) //Optional: 1 by default .WithPropertyHeader(p => p.Price, "Price")

Then, if another column gets inserted after A, moving Price to column C, no code modification will be needed.

imil avatar Mar 01 '18 23:03 imil