public IActionResult AddProduct(int?catId = null, int?subcatId = null) { string UserId = ClaimUtility.GetUserId(HttpContext.User); string _catId = _sellerService.GetSellerCategory(UserId); ViewBag.Categories = new SelectList(_sellerService.GetCategories().Data, "CategoryId", "Name", _catId); ViewBag.SubCategories = new SelectList(_sellerPanelService.GetSubCategories(int.Parse(_catId)).Data, "SubId", "SubName", subcatId); if (subcatId != null) { ViewBag.Products = new SelectList(_sellerPanelService.GetProduct(subcatId).Data, "ProductId", "ProductName"); } return(View()); }