public async Task <ObservableCollection <NewCategoryDetailModel.Deal> > GetAllByCategoryID2(int id = 0) { ObservableCollection <NewCategoryDetailModel.Deal> deals = new ObservableCollection <NewCategoryDetailModel.Deal>(); DealRootObject dealRootObject = new DealRootObject(); var respo = await APIService.Get($"api/all/getallbycategoryid2?id={id}"); if (respo.StatusCode == System.Net.HttpStatusCode.OK) { var content = await respo.Content.ReadAsStringAsync(); var categoryDetail = JsonConvert.DeserializeObject <NewCategoryDetailModel.RootObject>(content); if (categoryDetail.Message.Contains("Success")) { //ActvRootList = JsonConvert.DeserializeObject<ObservableCollection<Activity_RootObject>>(content); deals = categoryDetail.Deals; } } else { var content = await respo.Content.ReadAsStringAsync(); } return(deals); }
public async Task <ObservableCollection <Deals> > GetDealsOriginal(string id = "") { DealRootObject deal = new DealRootObject(); ObservableCollection <Deals> listofdeals = new ObservableCollection <Deals>(); ObservableCollection <DealRootObject> deallist = new ObservableCollection <DealRootObject>(); var respo = await APIService.Get("api/deals"); if (respo.StatusCode == System.Net.HttpStatusCode.OK) { var content = await respo.Content.ReadAsStringAsync(); deal = JsonConvert.DeserializeObject <DealRootObject>(content); if (deal.Message.Contains("Success")) { listofdeals = deal.Deals; } } else { var content = await respo.Content.ReadAsStringAsync(); } return(listofdeals); }