public bool CreateNewApplicant(ApplicantCreateModel applicantCreateModel) { bool check = false; if (applicantCreateModel != null) { Applicant applicant = new Applicant { ApplicantId = Guid.NewGuid(), Address = applicantCreateModel.Address, Avatar = applicantCreateModel.Avatar, Birthdate = applicantCreateModel.Birthdate, Email = applicantCreateModel.Email, FullName = applicantCreateModel.FullName, Gender = applicantCreateModel.Gender, IdentifyCardNumer = applicantCreateModel.IdentifyCardNumer, Password = applicantCreateModel.Password, Phone = applicantCreateModel.Phone, SeflDescribe = applicantCreateModel.SeflDescribe, CreatedDate = DateTime.UtcNow, Status = true, ApplicantSkills = null }; _unitOfWork.GetRepository <Applicant>().Insert(applicant); _unitOfWork.Commit(); check = true; } return(check); }
public IActionResult CreateApplicant(ApplicantCreateModel applicantCreateModel) { if (applicantCreateModel == null) { return(BadRequest("Error")); } bool check = _applicantLogic.CreateNewApplicant(applicantCreateModel); if (!check) { return(BadRequest("Can not create new applicant")); } return(Ok("Success")); }