Ejemplo n.º 1
0
        public async Task <ActionResult> AddCompany(CompanyViewModel company)
        {
            if (!ModelState.IsValid)
            {
                ViewBag.Companies = _roomService.GetCompanies();
                return(View("ControlCompanies"));
            }

            await _roomService.AddCompanyAsync(_mapper.Map <Company>(company));

            return(RedirectToAction("Index"));
        }