Example #1
0
        private IQueryable <CameraModel> ReadFileToCollection(string path)
        {
            List <CameraModel> camList = new List <CameraModel>();

            using (var reader = new StreamReader(path))
            {
                string line;
                int    counter = 0;
                while ((line = reader.ReadLine()) != null)
                {
                    bool lineIsReadable = counter > 0 && !string.IsNullOrWhiteSpace(line);
                    if (lineIsReadable)
                    {
                        CameraModel newModel = LineToModel(line, counter);
                        camList.Add(newModel);
                    }
                    counter++;
                }
            }
            return(camList.AsQueryable());
        }
 public string FormatCamToString(CameraModel cam)
 {
     return(cam.Index + " | " + cam.Name + " | " + cam.Latitude + " | " + cam.Longitude);
 }