Created
December 27, 2015 15:56
-
-
Save miklund/f8e6c24cf230602abaa1 to your computer and use it in GitHub Desktop.
2009-08-19 Business loves Excel, Engineers loves XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Title: Business loves Excel, Engineers loves XML | |
# Author: Mikael Lundin | |
# Link: http://blog.mikaellundin.name/2009/08/19/business-loves-excel-engineers-loves-xml.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var repo = new ExcelRepository(this.filePath, ExcelVersion.PreExcel2007); | |
repo.AddMapping(x => x.Country, "COUNTRY"); | |
repo.AddMapping(x => x.ZipCode, "ZIPCODE"); | |
repo.AddMapping(x => x.City, "CITY"); | |
var q = from worksheet in repo.Worksheet(ZipCodeWorksheet.Name) | |
where worksheet.ZipCode == indata | |
select worksheet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ZipCodeWorksheet | |
{ | |
public const string Name = "Report"; | |
public string Country { get; set; } | |
public string ZipCode { get; set; } | |
public string City { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment