public override string CSVFromDataTable(DataTable dt) { if (dt == null) { throw new ArgumentNullException(nameof(dt)); } using (DataTable dtDst = new DataTable()) { dtDst.Locale = dt.Locale; CSVImporter.InitializeDataTable(dtDst); foreach (DataRow dr in dt.Rows) { CrewLogFlight clf = new CrewLogFlight(dr); CSVImporter.WriteEntryToDataTable(clf.ToLogbookEntry(), dtDst); } return(CsvWriter.WriteToString(dtDst, true, true)); } }
public override string CSVFromDataTable(DataTable dt) { if (dt == null) { throw new ArgumentNullException("dt"); } IEnumerable <CustomPropertyType> rgcpt = CustomPropertyType.GetCustomPropertyTypes(); using (DataTable dtDst = new DataTable()) { dtDst.Locale = dt.Locale; CSVImporter.InitializeDataTable(dtDst); foreach (DataRow dr in dt.Rows) { CrewLogFlight clf = new CrewLogFlight(dr, rgcpt); CSVImporter.WriteEntryToDataTable(clf.ToLogbookEntry(), dtDst); } return(CsvWriter.WriteToString(dtDst, true, true)); } }