public IActionResult Product(int?id) { if (id == null) { return(NotFound()); } var product = _repository.GetProductsById((int)id); if (product == null) { return(NotFound()); } return(View(product)); }