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

            SetLocalCities(cities);
            return(cities);
        }
예제 #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());
        }
예제 #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());
            }
        }