/// <summary> /// Function to createjobseekers additional information /// </summary> /// <param name="entity">Additional information object</param> public void Create(SkillSmart.Dto.Company entity) { Company seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.Company, SkillSmartMongoDA.Entities.Company>(entity); base.Create(seeker); entity.Id = seeker.Id; }
public new SkillSmart.Dto.RelatedExperience GetById(string id) { RelatedExperience dbObj = base.GetById(id); SkillSmart.Dto.RelatedExperience seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.RelatedExperience, SkillSmart.Dto.RelatedExperience>(dbObj); return(seeker); }
/// <summary> /// Function to create a new training course of jobseeker /// </summary> /// <param name="entity">TrainingCourseObject</param> public void Create(SkillSmart.Dto.TrainingCourse entity) { TrainingCourse seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.TrainingCourse, SkillSmartMongoDA.Entities.TrainingCourse>(entity); base.Create(seeker); entity.Id = seeker.Id; }
/// <summary> /// Function to get details of a skill alias /// </summary> /// <param name="id">SkillAliasId</param> /// <returns>Skill Alias Object</returns> public new SkillSmart.Dto.SkillAlias GetById(string id) { SkillAlias dbObj = base.GetById(id); SkillSmart.Dto.SkillAlias seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.SkillAlias, SkillSmart.Dto.SkillAlias>(dbObj); return(seeker); }
/// <summary> /// Function to get details of a language known by jobseeker /// </summary> /// <param name="id">languageid</param> /// <returns>details of language as object</returns> public new SkillSmart.Dto.Language GetById(string id) { Language dbObj = base.GetById(id); SkillSmart.Dto.Language seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.Language, SkillSmart.Dto.Language>(dbObj); return(seeker); }
/// <summary> /// Function to Create new work history details for the jobseeker /// </summary> /// <param name="entity">WorkHistory Object</param> public void Create(SkillSmart.Dto.WorkHistory entity) { WorkHistory seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.WorkHistory, SkillSmartMongoDA.Entities.WorkHistory>(entity); base.Create(seeker); entity.Id = seeker.Id; }
public new SkillSmart.Dto.JobPrerequisite GetById(string id) { JobPrerequisite dbObj = base.GetById(id); SkillSmart.Dto.JobPrerequisite seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.JobPrerequisite, SkillSmart.Dto.JobPrerequisite>(dbObj); return(seeker); }
/// <summary> /// Function to get a jobseeker details by Id /// </summary> /// <param name="id">jobseeker id</param> /// <returns>a jobseeker object</returns> public new SkillSmart.Dto.Employer GetById(string id) { Employer dbObj = base.GetById(id); SkillSmart.Dto.Employer employer = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.Employer, SkillSmart.Dto.Employer>(dbObj); return(employer); }
/// <summary> /// FUnction to get lookUp collection name by Id /// </summary> /// <param name="id">lookUp CollectionId</param> /// <returns>LookupDto object</returns> public new SkillSmart.Dto.LookupDto GetById(string id) { LookupEntity dbObj = base.GetById(id); SkillSmart.Dto.LookupDto seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.LookupEntity, SkillSmart.Dto.LookupDto>(dbObj); return(seeker); }
/// <summary> /// Function to get all jobseeker details /// </summary> /// <returns>List of jobseekers</returns> public IEnumerable <SkillSmart.Dto.JobSeekerAppliedJobs> GetAllJobsJobSeeker(string jobSeekerId) { var jobList = this.MongoCollection.FindAllAs <JobSeekerAppliedJobs>(); //get all jobseekers //Creating jobseeker object jobSeekerCursor List <SkillSmart.Dto.JobSeekerAppliedJobs> jobSeekerAppliedCursor = new List <SkillSmart.Dto.JobSeekerAppliedJobs>(); foreach (JobSeekerAppliedJobs jobSeeker in jobList) { if (jobSeeker.JobSeekerId == jobSeekerId) { SkillSmart.Dto.JobSeekerAppliedJobs jobSeekerObj = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.JobSeekerAppliedJobs, SkillSmart.Dto.JobSeekerAppliedJobs>(jobSeeker); jobSeekerAppliedCursor.Add(jobSeekerObj); } /*else * { * if (jobSeeker.JobId == id) * { * SkillSmart.Dto.JobSeekerAppliedJobs jobSeekerObj = MapperUtilities.MapToViewModel<SkillSmartMongoDA.Entities.JobSeekerAppliedJobs, SkillSmart.Dto.JobSeekerAppliedJobs>(jobSeeker); * jobSeekerAppliedCursor.Add(jobSeekerObj); * } * }*/ } return(jobSeekerAppliedCursor); }
/// <summary> /// Function to get a scholoaship deatils /// </summary> /// <param name="id">ScholarshipId</param> /// <returns>Scholarship Object</returns> public new SkillSmart.Dto.Scholarship GetById(string id) { Scholarship dbObj = base.GetById(id); SkillSmart.Dto.Scholarship seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.Scholarship, SkillSmart.Dto.Scholarship>(dbObj); return(seeker); }
/// <summary> /// Function to create a scholoaship /// </summary> /// <param name="entity">Scholarship Object</param> public void Create(SkillSmart.Dto.Scholarship entity) { Scholarship seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.Scholarship, SkillSmartMongoDA.Entities.Scholarship>(entity); base.Create(seeker); entity.Id = seeker.Id; }
/// <summary> /// Function to get an ExtraCurricular Activity details /// </summary> /// <param name="id">ExtraCurricularActivityId</param> /// <returns>ExtraCurricularActivity Object</returns> public new SkillSmart.Dto.ExtraCurricularActivity GetById(string id) { ExtraCurricularActivity dbObj = base.GetById(id); SkillSmart.Dto.ExtraCurricularActivity seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.ExtraCurricularActivity, SkillSmart.Dto.ExtraCurricularActivity>(dbObj); return(seeker); }
/// <summary> /// Function to get all extra curricular activity /// </summary> /// <param name="entity">ExtraCurricularActivity Object</param> public void Create(SkillSmart.Dto.ExtraCurricularActivity entity) { ExtraCurricularActivity seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.ExtraCurricularActivity, SkillSmartMongoDA.Entities.ExtraCurricularActivity>(entity); base.Create(seeker); entity.Id = seeker.Id; }
/// <summary> /// Function to Create new work history details for the jobseeker /// </summary> /// <param name="entity">WorkHistory Object</param> public void Create(SkillSmart.Dto.SavedJobSearch entity) { SavedJobSearch seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.SavedJobSearch, SkillSmartMongoDA.Entities.SavedJobSearch>(entity); base.Create(seeker); entity.Id = seeker.Id; }
/// <summary> /// Function to get details of a skill of the JobSeeker /// </summary> /// <param name="id"></param> /// <returns>JobseekerSkill Object</returns> public new SkillSmart.Dto.JobSeekerSkillList GetById(string id) { JobSeekerSkillList dbObj = base.GetById(id); SkillSmart.Dto.JobSeekerSkillList seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.JobSeekerSkillList, SkillSmart.Dto.JobSeekerSkillList>(dbObj); return(seeker); }
/// <summary> /// Function to get details of a particular work history of the jobseeker /// </summary> /// <param name="id">WorkHistoryId</param> /// <returns>WorkHistory Object</returns> public new SkillSmart.Dto.SavedJobSearch GetById(string id) { SavedJobSearch dbObj = base.GetById(id); SkillSmart.Dto.SavedJobSearch seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.SavedJobSearch, SkillSmart.Dto.SavedJobSearch>(dbObj); return(seeker); }
/// <summary> /// Function to create a new language for jobseeker /// </summary> /// <param name="entity">languagae object</param> public void Create(SkillSmart.Dto.Language entity) { Language seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.Language, SkillSmartMongoDA.Entities.Language>(entity); base.Create(seeker); entity.Id = seeker.Id; }
public async Task GetSettingValue_TestKeyString_ReturnsKeyValue() { // Arrange var options = DatabaseUtilities.GetTestDbConextOptions <CompanyNameProjectNameContext>(); var testSetting = new Setting() { Key = "TestKey", Value = "TestValue", Type = typeof(string).ToString(), DisplayName = "Test Key", Description = "For Testing GetSettingValue" }; using (var context = new CompanyNameProjectNameContext(options)) { context.Database.OpenConnection(); context.Database.EnsureCreated(); var settingsRepository = new SettingsRepository(context, MapperUtilities.GetTestMapper()); await settingsRepository.CreateAsync(testSetting); } using (var context = new CompanyNameProjectNameContext(options)) { var settingsRepository = new SettingsRepository(context, MapperUtilities.GetTestMapper()); // Act var value = await settingsRepository.GetSettingValue("TestKey", string.Empty); // Assert Assert.AreEqual(value, testSetting.Value); } }
/// <summary> /// Function to get all jobseeker details /// </summary> /// <returns>List of jobseekers</returns> public IEnumerable <SkillSmart.Dto.JobSkills> GetAll(string jobId) { List <SkillSmart.Dto.JobSkills> jobListCursor = new List <SkillSmart.Dto.JobSkills>(); if (jobId == "") { var jobSeekerList = this.MongoCollection.FindAllAs <JobSkills>(); //get all jobseekers //Creating jobseeker object jobSeekerCursor foreach (JobSkills jobSeeker in jobSeekerList) { SkillSmart.Dto.JobSkills jobSeekerObj = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.JobSkills, SkillSmart.Dto.JobSkills>(jobSeeker); jobListCursor.Add(jobSeekerObj); } } else { string[] split = jobId.Split(','); List <string> jobIdList = new List <string>(); foreach (string item in split) { jobIdList.Add(item); } var JobSkills = this.MongoCollection.AsQueryable <JobSkills>().Where(c => jobIdList.Contains(c.JobId)); foreach (JobSkills jobSeeker in JobSkills) { SkillSmart.Dto.JobSkills jobSeekerObj = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.JobSkills, SkillSmart.Dto.JobSkills>(jobSeeker); jobListCursor.Add(jobSeekerObj); } } return(jobListCursor); }
public new SkillSmart.Dto.SkillSupportingMaterial GetById(string id) { SkillSupportingMaterial dbObj = base.GetById(id); SkillSmart.Dto.SkillSupportingMaterial seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.SkillSupportingMaterial, SkillSmart.Dto.SkillSupportingMaterial>(dbObj); return(seeker); }
/// <summary> /// Function to get a Category details /// </summary> /// <param name="id">CategoryId</param> /// <returns>Category object</returns> public new SkillSmart.Dto.Category GetById(string id) { Category dbObj = base.GetById(id); SkillSmart.Dto.Category seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.Category, SkillSmart.Dto.Category>(dbObj); return(seeker); }
/// <summary> /// Function to create jobseeker overview /// </summary> /// <param name="entity">jobseeker overview object</param> public void Create(SkillSmart.Dto.Overview entity) { Overview seekerOverview = MapperUtilities.MapToDomainModel <SkillSmart.Dto.Overview, SkillSmartMongoDA.Entities.Overview>(entity); base.Create(seekerOverview); entity.Id = seekerOverview.Id; }
/// <summary> /// Function to get details of a particular jobseeker training course /// </summary> /// <param name="id">TrainingCourseId</param> /// <returns></returns> public new SkillSmart.Dto.TrainingCourse GetById(string id) { TrainingCourse dbObj = base.GetById(id); SkillSmart.Dto.TrainingCourse seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.TrainingCourse, SkillSmart.Dto.TrainingCourse>(dbObj); return(seeker); }
/// <summary> /// Function to Get all skills of a jobseeker /// </summary> /// <param name="id">JobSeekerId</param> /// <returns>JobseekerSkill Object</returns> public IEnumerable <SkillSmart.Dto.JobSeekerSkillList> GetAllJobSeekersSkillsListForSkillId(string id) { string[] split = id.Split(','); List <string> jobSkillsIdList = new List <string>(); foreach (string item in split) { jobSkillsIdList.Add(item); } List <SkillSmart.Dto.JobSeekerSkillList> jobSeekerWorkHostory = new List <SkillSmart.Dto.JobSeekerSkillList>(); var queryble = this.MongoCollection.AsQueryable <JobSeekerSkillList>().Where(c => jobSkillsIdList.Contains(c.SkillMapId)); List <string> jobSeekerIdList = new List <string>(); foreach (JobSeekerSkillList jobSeeker in queryble) { if (!jobSeekerIdList.Contains(jobSeeker.JobSeekerId)) { jobSeekerIdList.Add(jobSeeker.JobSeekerId); } } var jobSeekerWorkHistoryList = this.MongoCollection.AsQueryable <JobSeekerSkillList>().Where(c => jobSeekerIdList.Contains(c.JobSeekerId)); foreach (JobSeekerSkillList jobSeeker in jobSeekerWorkHistoryList) { SkillSmart.Dto.JobSeekerSkillList jobSeekerObj = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.JobSeekerSkillList, SkillSmart.Dto.JobSeekerSkillList>(jobSeeker); jobSeekerWorkHostory.Add(jobSeekerObj); } return(jobSeekerWorkHostory); }
public new SkillSmart.Dto.Education GetById(string id) { Education dbObj = base.GetById(id); SkillSmart.Dto.Education seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.Education, SkillSmart.Dto.Education>(dbObj); return(seeker); }
/// <summary> /// Function to get all Category by parentId /// </summary> /// <param name="id">CategoryId</param> /// <returns>Category object</returns> public IEnumerable <SkillSmart.Dto.Prerequisite> GetAllPrerequisiteById(string id) { List <SkillSmart.Dto.Prerequisite> prerequisite = new List <SkillSmart.Dto.Prerequisite>(); if (id == "") { var allPrerequisiteList = this.MongoCollection.FindAllAs <Prerequisite>(); List <SkillSmart.Dto.Prerequisite> skillList = new List <SkillSmart.Dto.Prerequisite>(); foreach (Prerequisite jobSeeker in allPrerequisiteList) { SkillSmart.Dto.Prerequisite jobSeekerObj = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.Prerequisite, SkillSmart.Dto.Prerequisite>(jobSeeker); skillList.Add(jobSeekerObj); } } else { var prerequisiteList = this.MongoCollection.AsQueryable <Prerequisite>().Where(e => e.ParentId == id); foreach (Prerequisite jobSeeker in prerequisiteList) { SkillSmart.Dto.Prerequisite jobSeekerObj = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.Prerequisite, SkillSmart.Dto.Prerequisite>(jobSeeker); prerequisite.Add(jobSeekerObj); } } return(prerequisite); }
public new SkillSmart.Dto.JobSeekerAppliedJobs GetById(string id) { JobSeekerAppliedJobs dbObj = base.GetById(id); SkillSmart.Dto.JobSeekerAppliedJobs seeker = MapperUtilities.MapToViewModel <SkillSmartMongoDA.Entities.JobSeekerAppliedJobs, SkillSmart.Dto.JobSeekerAppliedJobs>(dbObj); return(seeker); }
public void Create(SkillSmart.Dto.Education entity) { Education seeker = MapperUtilities.MapToDomainModel <SkillSmart.Dto.Education, SkillSmartMongoDA.Entities.Education>(entity); base.Create(seeker); entity.Id = seeker.Id; }
public async Task GetMessagesAsync_ChannelId3_ReturnsEmptyList(MessagesResourceParameters messagesResourceParameters) { // Arrange var options = DatabaseUtilities.GetTestDbConextOptions <CompanyNameProjectNameContext>(); var user = new User() { Email = "*****@*****.**", FirstName = "Test", LastName = "User" }; var messageOne = new Message() { Text = "Test Message One", ChannelId = 1, }; var messageTwo = new Message() { Text = "Test Message Two", ChannelId = 2, }; using (var context = new CompanyNameProjectNameContext(options)) { context.Database.OpenConnection(); context.Database.EnsureCreated(); // Add a user because we need a UserId foreign key for the messages var usersRepository = new UsersRepository(context, MapperUtilities.GetTestMapper()); await usersRepository.CreateAsync(user); } using (var context = new CompanyNameProjectNameContext(options)) { var messagesRepository = new MessagesRepository(context, MapperUtilities.GetTestMapper()); messageOne.UserId = user.Id; messageTwo.UserId = user.Id; // Add the messages await messagesRepository.CreateAsync(messageOne); await messagesRepository.CreateAsync(messageTwo); } using (var context = new CompanyNameProjectNameContext(options)) { var messagesRepository = new MessagesRepository(context, MapperUtilities.GetTestMapper()); // Act var results = await messagesRepository.GetMessagesAsync(messagesResourceParameters); // Assert Assert.AreEqual(results.Count(), 0); } }