public ClaimsIdentity CreateCandidateIdentity(CandidateUser user) { var identity = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, user.Name), new Claim(ClaimTypes.Sid, user.Id), new Claim(ClaimTypes.Role, "Candidate"), new Claim(ClaimTypes.Email, user.Email) }, "ApplicationCookie"); return identity; }
public CandidateUser MapToCandidateUser(CandidateUserModel candidateModel) { var skills = MapSkillModelsToSkills(candidateModel.Skills); var candidate = new CandidateUser() { ExperienceDescription = candidateModel.ExperienceDescription, ExperienceInYears = candidateModel.ExperienceInYears, Salary = candidateModel.Salary, Skills = skills, }; return candidate; }
private async Task CreateAndInsertCandidateUser(string candidateName, int candidateNumber, Random random) { var skills = GenerateSkillList(random); var candidateUser = new CandidateUser() { Name = candidateName + candidateNumber, Email = candidateName + candidateNumber + "@" + candidateName + ".pl", ModificationDate = DateTime.UtcNow, Salary = random.Next(1000, 20000), ExperienceInYears = random.Next(1,51), Skills = skills, }; SetPassword(candidateUser, "candidate"); await _databaseService.InsertCaniddateUserAsync(candidateUser); }
public async Task UpdateCandidateAsync(CandidateUser candidate, string candidateId) { var filter = Builders<CandidateUser>.Filter.Eq(r => r.Id, candidateId); var update = Builders<CandidateUser> .Update .Set(r => r.ExperienceDescription, candidate.ExperienceDescription) .Set(r => r.ExperienceInYears, candidate.ExperienceInYears) .Set(r => r.Salary, candidate.Salary) .Set(r => r.Skills, candidate.Skills) .Set(r => r.ModificationDate, candidate.ModificationDate); await dbContext.CandidateUsers.UpdateOneAsync(filter, update); }
public async Task InsertCaniddateUserAsync(CandidateUser user) { await dbContext.CandidateUsers.InsertOneAsync(user); }
public CandidateUserModel MapToCandidateUserModel(CandidateUser candidate) { var skillModels = MapSkillsToSkillModels(candidate.Skills); var candidateModel = new CandidateUserModel(candidate.Salary, candidate.ExperienceDescription, candidate.ExperienceInYears, skillModels); return candidateModel; }
public CandidateUser MapToCandidateUser(string name, string email) { var user = new CandidateUser { Name = name, Email = email, }; return user; }
public ScoredCandidateModel MapToScoredCandidateModel(CandidateUser candidate, double score) { var skillModels = MapSkillsToSkillModels(candidate.Skills); var scoredCandidateModel = new ScoredCandidateModel(candidate.Name, candidate.Salary, candidate.ExperienceDescription, candidate.ExperienceInYears, score, skillModels); return scoredCandidateModel; }
public OfferSearchModel MapToOfferSearchModel(CandidateUser candidate) { var skillModels = MapSkillsToSkillModels(candidate.Skills); var offerSearchModel = new OfferSearchModel(skillModels, candidate.Salary); return offerSearchModel; }
public ScoredCandidateViewModel GetScoredCandidateViewModel(double score, CandidateUser candidate) { var scoredCandidateModel = _mappingService.MapToScoredCandidateModel(candidate, score); var scoredCandidateViewModel = _mappingService.MapToScoredCandidateViewModel(scoredCandidateModel, candidate.ModificationDate, candidate.Id); return scoredCandidateViewModel; }