public RecruitmentRequest(Contractype type, RequestingDepartment department, int yearsOfExperience, string jobTitle, string jobDescription, User user) { Contractype = type; RequestingDepartment = department; YearsOfExperience = yearsOfExperience; JobTitle = jobTitle; JobDescription = jobDescription; User = user; }
public RecruitmentRequest Create(Contractype contractype, RequestingDepartment requestingDepartment, string yearsOfExperience, string jobTitle, string jobDescription, User user) { if (string.IsNullOrEmpty(yearsOfExperience)) { throw new ApplicationException("Years of experience for the job is not specified"); } if (string.IsNullOrEmpty(jobTitle)) { throw new ApplicationException("Job Title is not specified"); } var recruitmentRequest = new RecruitmentRequest(contractype, requestingDepartment, int.Parse(yearsOfExperience), jobTitle, jobDescription, user); Seed.recruitmentRequests.Add(recruitmentRequest); return(recruitmentRequest); }