public static async Task <IList <City> > GetHasCompanyAsync(int subCategoryId)
        {
            var rest   = new CityRest();
            var cities = await rest.GetHasCompanyAsync(subCategoryId) ?? GetLocalCities();

            SetLocalCities(cities);
            return(cities);
        }
Esempio n. 2
0
        public async Task <IList <City> > GetHasCompanyAsync(int subCategoryId)
        {
            var service = new CityRest();
            var items   = await service.GetHasCompanyAsync(subCategoryId);

            ApplicationManager <string> .AddOrUpdate("cities", items);

            return(items.OrderBy(o => o.Name).ToList());
        }
Esempio n. 3
0
        public static async Task <IList <City> > GetHasCompanyAsync(int subCategoryId)
        {
            var rest   = new CityRest();
            var result = await rest.GetHasCompanyAsync(subCategoryId);

            if (result.IsValid)
            {
                SetLocalCities(result.Value);
                return(result.Value);
            }
            else
            {
                return(GetLocalCities());
            }
        }