public IActionResult Index(int id) { try { var manufacturer = Repository.GetManufacturer(id); if (manufacturer == null) { return(NotFound()); } ViewBag.Title = $"Products of {manufacturer.Name}"; return(View(manufacturer)); } catch (Exception e) { return(BadRequest($"Failed to get manufacturer with the following id: {id}. {e}")); } }
public IActionResult UpdateManufacturer(int manufacturerId) { ViewBag.Title = $"Update manufacturer page"; return(View(Repository.GetManufacturer(manufacturerId))); }