Beispiel #1
0
 //TODO:Singleton olacak
 public List <CountryDTO> GetCountry()
 {
     if (FileIOHelper.FileExists(_countryFileName) == false)
     {
         UpdateCountries();
     }
     try
     {
         var taskResponse = Helpers.FileIOHelper.ReadData(_countryFileName);
         return(JsonConvert.DeserializeObject <List <CountryDTO> >(taskResponse.Result));
     }
     catch (StackOverflowException ex)
     {
         throw (ex);
     }
 }
Beispiel #2
0
        public List <VehicleDTO> GetVehicles()
        {
#if DEBUG
            return(getVehicleMockData());
#else
            if (FileIOHelper.FileExists(_vehicleFileName) == false)
            {
                UpdateVehicles();
            }
            try
            {
                var taskResponse = Helpers.FileIOHelper.ReadData(_vehicleFileName);
                return((List <VehicleDTO>)JsonConvert.DeserializeObject <List <VehicleDTO> >(taskResponse.Result));
            }
            catch (StackOverflowException ex)
            {
                throw (ex);
            }
#endif
        }