private static void ReadUsers(Config c) { c.OrgsWithPATs = AzDevOpsReader.LoadAllOrgsFromPAT(c).Result.ToArray(); var result = AzDevOpsReader.ReadUsers(c); var wb = new XLWorkbook(); foreach (var key in result.Result.Keys) { var ws = wb.Worksheets.Add("Users - " + key); DataTable table; result.Result.TryGetValue(key, out table); var insertedTable = ws.Cell(1, 1).InsertTable(table); ws.Columns().AdjustToContents(); } wb.SaveAs("Users.xlsx"); }
public async Task <Dictionary <string, DataTable> > GetAzDevOpsResult(Config config) { if (config.Mode == Mode.Users) { return(await AzDevOpsReader.ReadUsers(config)); } else if (config.Mode == Mode.History) { return new Dictionary <string, DataTable>() { { "History", await AzDevOpsReader.ReadHistory(config) } } } ; else { return new Dictionary <string, DataTable>() { { "WorkItems", await AzDevOpsReader.ReadWIs(config) } } }; } }