示例#1
0
        public IActionResult New(NewJobViewModel newJobViewModel)
        {
            // TODO #6 COMPLETED - Validate the ViewModel and if valid, create a
            // new Job and add it to the JobData data store. Then
            // redirect to the Job detail (Index) action/view for the new Job.

            if (ModelState.IsValid)
            {
                return(Redirect($"Index?id={jobData.AddJob(newJobViewModel)}"));
            }

            return(View(newJobViewModel));
        }