Beispiel #1
0
        /// <summary>
        /// writes to json file based on user csv file path
        /// </summary>
        static void WriteJsonFile <T>()
        {
            string   path = GetPath();
            List <T> taxi = JsonTaxi.CsvToList <T>(path);

            path = WriteToPath();
            JsonTaxi.WriteToJson(taxi, path);
        }
Beispiel #2
0
        /// <summary>
        /// writes to csv file based on file specified by user
        /// </summary>
        static void WriteCsvFile <T>()
        {
            string   path = GetPath();
            List <T> list = new List <T>();
            Type     t    = typeof(T);

            if (t.Name != "String")
            {
                list = JsonTaxi.JsonToList <T>(path);
                path = WriteToPath();
                JsonTaxi.ListToCsv(list, path);
            }
            else
            {
                list = JsonTaxi.JsonToList <T>(path);
                path = WriteToPath();
                JsonTaxi.ConvertStringToCsV(list, path);
            }
        }