public IActionResult UrunDuzenle(int id) { ViewBag.Kategoriler = new SelectList(kategoriRepo.GetAll(), "KategoriId", "KategoriAd"); Urun urun = urunRepo.GetbyId(id); if (urun == null) { return(RedirectToAction("UrunList")); } UrunImageModel model = new UrunImageModel() { Urun = urun, Images = imageRepo.GetByUrunId(urun.UrunId).ToList() }; return(View(model)); }
public IActionResult Detay(int id) { Urun urun = urunRepo.GetbyId(id); if (urun != null) { UrunImageModel model = new UrunImageModel() { Urun = urun, Images = imageRepo.GetByUrunId(id).ToList() }; return(View(model)); } return(RedirectToAction("Index", "Home")); }