public IActionResult ProcessAddEmployerForm(AddEmployerViewModel addEmployerViewModel)
        {
            if (ModelState.IsValid == true)
            {
                // return View(addEmployerViewModel);

                context.Employers.Add(addEmployerViewModel.ToEmployer());
            }
            context.SaveChanges();
            return(Redirect("/Employer"));
        }
Beispiel #2
0
        public IActionResult Add(AddEmployerViewModel addEmployerViewModel)
        {
            if (ModelState.IsValid == false)
            {
                return(View(addEmployerViewModel));
            }

            _jobDbContext.Employers.Add(addEmployerViewModel.ToEmployer());

            _jobDbContext.SaveChanges();

            return(Redirect("Index"));
        }