public IActionResult Create(CreateCompanyViewModel model) { if (ModelState.IsValid) { var company = new Company { ContactEmail = model.ContactEmail, ContactPhoneNumber = model.ContactPhoneNumber, MainAddress = model.MainAddress, Name = model.Name }; _companyData.Add(company); _companyData.Commit(); return(RedirectToAction(nameof(Index))); } return(View(model)); }