private void PopulateList() { _ads = _service.GetAdvertisementsByUser(BikenBike.CurrentUser.Id); if (_ads != null) { foreach (var ad in _ads) { listView.Items.Add(ad); } } }
public ActionResult ViewAds() { var id = Session["ID"]; List <Advertisement> ads = client.GetAdvertisementsByUser(Convert.ToInt32(id)); // List<AdvertisementDetails> adss = new List<AdvertisementDetails>(); // // foreach (var ad in ads) // { // adss.Add(new AdvertisementDetails {Advertisement = ad,Bicycle = ad.Bike}); // } return(View(ads)); }