コード例 #1
0
        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}"));
            }
        }
コード例 #2
0
        public IActionResult UpdateManufacturer(int manufacturerId)
        {
            ViewBag.Title = $"Update manufacturer page";

            return(View(Repository.GetManufacturer(manufacturerId)));
        }