public IActionResult UsersAllProduct() { var result = new AllUsersProductViewModel() { All = this.userServices.AllProducts() }; return(View(result)); }
public IActionResult SearchProduct(string searchString) { if (!String.IsNullOrEmpty(searchString)) { var result = new AllUsersProductViewModel() { All = this.userServices.SearchProducts(searchString) }; if (result == null) { TempData["Error"] = "The product is not find"; return(RedirectToAction(nameof(UsersAllProduct))); } return(View("UsersAllProduct", result)); } this.TempData["Error"] = " The search string is null or empty !!!!"; return(RedirectToAction(nameof(UsersAllProduct))); }