public Applicant(ApplicantVM applicantVm, Post postX) { FullName = applicantVm.FullName; IdNumber = applicantVm.INumber; PhoneNumber = applicantVm.PhoneNumber; Email = applicantVm.Email; City = applicantVm.City; Specialization = applicantVm.Specialization; Skill = applicantVm.Skill; Gender = applicantVm.Gender; DateOfBirth = applicantVm.DateOfBirth; post = postX; Gpa = applicantVm.Gpa; }
public async Task AddApplicant(ApplicantVM vm, Post post) { var ap = new Applicant(vm, post) { isAccepted = false }; //var filePath = Path.GetTempFileName() + Path.GetExtension(vm.Cv.FileName); //if (vm.Cv.Length > 0) //{ // using (var stream = new FileStream(filePath, FileMode.Create)) // { // await vm.Cv.CopyToAsync(stream); // ap.CvPath = filePath; // } //} _context.Applicants.Add(ap); await _context.SaveChangesAsync(); }