private static void Run() { // Instantiate Worker var worker = new Worker(@"C:\Test\initial.docx", @"C:\Test\output.docx"); //Setup properties mappings var dict = new Dictionary <string, Func <string> > { { "Fullname", () => aitisi.FullName }, { "MobileNumber", () => aitisi.Mobile }, { "IsCurrent", () => aitisi.IsExisting ? "X" : " " }, { "IsNew", () => aitisi.IsExisting ? " " : "X" } }; //Set them worker.SetDictMapper(dict); //Create a list mapper for each table var listMapper = new ListMapper(@"MyTable"); foreach (var syndesi in aitisi.NeaSyndesi) { var dictionary = new Dictionary <string, Func <string> >() { { "ServiceId", () => syndesi.ServiceId }, { "Armodios", () => syndesi.Armodios }, { "TyposYphresias", () => syndesi.TyposYphresias } }; listMapper.List.Add(dictionary); } //Add List mapper worker.AddListMapper(listMapper); var listMapperTable_Metavoli_Taxythtas = new ListMapper(@"Table_Metavoli_Taxythtas"); foreach (var syndesi in aitisi.NeaSyndesi) { var dictionary = new Dictionary <string, Func <string> >() { { "Table_Metavoli_Taxythtas_ServiceId", () => syndesi.ServiceId }, }; listMapperTable_Metavoli_Taxythtas.List.Add(dictionary); } //Add List mapper worker.AddListMapper(listMapperTable_Metavoli_Taxythtas); //Execute worker.Execute(); }
public void AddListMapper(ListMapper listMapper) { _tableMapperList.Add(listMapper); }