Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miklund/f8e6c24cf230602abaa1 to your computer and use it in GitHub Desktop.
Save miklund/f8e6c24cf230602abaa1 to your computer and use it in GitHub Desktop.
2009-08-19 Business loves Excel, Engineers loves XML
# 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
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;
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