Example #1
0
 private void LoadFromCSV()
 {
     VapeModelList = File.ReadAllLines(_sourcePath)
                     .Skip(1)
                     .Select(v => VapeModel.LoadData(v))
                     .ToList();
 }
Example #2
0
        public static VapeModel LoadData(string csvLine)
        {
            VapeModel vape = new VapeModel();

            string[] values = csvLine.Split(',');
            vape._deviceName   = Convert.ToString(values[0]);
            vape._model        = Convert.ToString(values[1]);
            vape._tankCapacity = Convert.ToInt16(values[2]);
            vape._processed    = Convert.ToBoolean(values[3]);

            return(vape);
        }