public IEnumerable<ZipCodeData> GetZips(int range) { List<ZipCodeData> lstZipCodeData = null; if (!String.IsNullOrWhiteSpace(this.zip)) { IZipCodeRepository zipCodeRepository = new ZipCodeRepository(); IEnumerable<ZipCode> zipCodeList = zipCodeRepository.GetZipsForRange(new ZipCode { Zip = this.zip }, range); if (zipCodeList != null) { lstZipCodeData = new List<ZipCodeData>(); foreach (ZipCode zipCode in zipCodeList) { lstZipCodeData.Add(new ZipCodeData { ZipCode = zipCode.Zip, City = zipCode.City, State = zipCode.State.Abbreviation }); } } } return lstZipCodeData; }
public IEnumerable <ZipCodeData> GetZips(string zip, int range) { var zipCodeData = new List <ZipCodeData>(); var zipCodeRepository = new ZipCodeRepository(); var zipEntity = zipCodeRepository.GetByZip(zip); var zips = zipCodeRepository.GetZipsForRange(zipEntity, range); if (zips != null) { foreach (var zipCode in zips) { zipCodeData.Add(new ZipCodeData { City = zipCode.City, State = zipCode.State.Abbreviation, ZipCode = zipCode.Zip }); } } return(zipCodeData); }
public IEnumerable <ZipCodeData> GetZips(int range) { List <ZipCodeData> zipCodeData = new List <ZipCodeData>(); if (_ZipCodeEntity != null) { IZipCodeRepository zipCodeRepository = new ZipCodeRepository(); var zips = zipCodeRepository.GetZipsForRange(_ZipCodeEntity, range); if (zips != null) { foreach (ZipCode zipCode in zips) { zipCodeData.Add(new ZipCodeData { City = zipCode.City, State = zipCode.State.Abbreviation, ZipCode = zipCode.Zip }); } } } return(zipCodeData); }
public IEnumerable<ZipCodeData> GetZips(int range) { List<ZipCodeData> zipCodeData = new List<ZipCodeData>(); if (_ZipCodeEntity != null) { IZipCodeRepository zipCodeRepository = new ZipCodeRepository(); IEnumerable<ZipCode> zips = zipCodeRepository.GetZipsForRange(_ZipCodeEntity, range); if (zips != null) { foreach (var zipCode in zips) { zipCodeData.Add(new ZipCodeData() { ZipCode = zipCode.Zip, City = zipCode.City, State = zipCode.State.Abbreviation }); } } } return zipCodeData; }
public IEnumerable<ZipCodeData> GetZips(int range) { List<ZipCodeData> zipCodeData = new List<ZipCodeData>(); if (this.zipCodeEntity != null) { IZipCodeRepository zipCodeRepository = new ZipCodeRepository(); IEnumerable<ZipCode> zips = zipCodeRepository.GetZipsForRange(this.zipCodeEntity, range); if (zips != null) { foreach (var zipCode in zips) { zipCodeData.Add(new ZipCodeData() { City = zipCode.City, State = zipCode.State.Abbreviation, ZipCode = zipCode.Zip }); } } } // else // { // throw new ApplicationException("Uh oh"); // } return zipCodeData; }
public IEnumerable<ZipCodeData> GetZips(int range) { List<ZipCodeData> stateFulzipCodeData = new List<ZipCodeData>(); if (this._StateFulZipCodeEntity != null) { IZipCodeRepository stateFulzipCodeRepo = new ZipCodeRepository(); IEnumerable<ZipCode> stateFulZips = stateFulzipCodeRepo.GetZipsForRange(this._StateFulZipCodeEntity, range); foreach (ZipCode zipCopde in stateFulZips) { stateFulzipCodeData.Add(new ZipCodeData() { City = zipCopde.City, State = zipCopde.State.Abbreviation, ZipCode = zipCopde.Zip } ); } } return stateFulzipCodeData; }
public IEnumerable <ZipCodeData> GetZips(int range) { List <ZipCodeData> zipCodeData = new List <ZipCodeData>(); if (_zipCodeEntity != null) { ZipCodeRepository zipCodeRepository = new ZipCodeRepository(); var zips = zipCodeRepository.GetZipsForRange(_zipCodeEntity, range); if (zips != null) { foreach (ZipCode zipCode in zips) { zipCodeData.Add(LocalConfiguration.Mapper.Map <ZipCodeData>(zipCode)); } } } else { throw new ArgumentException("Uh no"); } return(zipCodeData); }