Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,ImgUrl")] Industry industry)
        {
            if (ModelState.IsValid)
            {
                var name        = industry.Name;
                var imgUrl      = industry.ImgUrl;
                var newIndustry = await _industryServices.CreateIndustry(name, imgUrl);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(industry));
        }
        public async Task <IActionResult> Create(string name, string imgUrl)
        {
            await _industriesServices.CreateIndustry(name, imgUrl);

            return(Created("POST", name));
        }