public IActionResult CreateCandidate(CreateCandidateVM model)
        {
            if (ModelState.IsValid)
            {
                var candidate = ConvertModel.CandidateVMToCandidate(model, _dataRepository);

                if (model.Resume != null)
                {
                    candidate.ResumePath = UploadFile(model.Resume, model.FullName);
                }

                var result = _dataRepository.AddCandidate(candidate);
                return(RedirectToAction("CandidateDetail", new { id = result.Id }));
            }

            return(View("Index"));
        }
        public IActionResult CreateCandidate()
        {
            var model = new CreateCandidateVM()
            {
                Genders = _dataRepository.GetDimValuesByName(nameof(Gender)).Select(a => new SelectListItem {
                    Value = a.Id.ToString(), Text = a.Name
                }).ToList(),
                JobStates = _dataRepository.GetDimValuesByName(nameof(JobState)).Select(a => new SelectListItem {
                    Value = a.Id.ToString(), Text = a.Name
                }).ToList(),
                TechStacks = _dataRepository.GetDimValuesByName(nameof(TechStack)).Select(a => new SelectListItem {
                    Value = a.Id.ToString(), Text = a.Name
                }).ToList(),
                Projects = _dataRepository.GetDimValuesByName(nameof(Project)).Select(a => new SelectListItem {
                    Value = a.Id.ToString(), Text = a.Name
                }).ToList(),
            };

            return(View(model));
        }