public JobType( JobStateRepository jobStateRepository, JobRepository jobRepository, SkillRepository skillRepository, JobSkillRepository jobSkillRepository ) { Field(x => x.Id, type: typeof(IdGraphType)); Field(x => x.Title, nullable: true); Field(x => x.Description, nullable: true); Field <JobStateType>( "jobState", resolve: context => { if (context.Source.JobStateId != null) { return(jobStateRepository.GetById((Guid)context.Source.JobStateId)); } return(null); } ); //// Async test //FieldAsync<JobStateType>( // "jobState", // resolve: async context => // { // if (context.Source.JobStateId != null) { // return await context.TryAsyncResolve( // async c => await jobStateRepository.GetByIdAsync((Guid)context.Source.JobStateId) // ); // } // // return null; // } //); Field <ListGraphType <SkillType> >( "skills", resolve: context => skillRepository.GetByJobId(context.Source.Id) ); //// Async test //FieldAsync<ListGraphType<SkillType>>( // "skills", // resolve: async context => // { // return await context.TryAsyncResolve( // async c => await skillRepository.GetByJobIdAsync(context.Source.Id) // ); // } //); Field(x => x.CreatedByUserId, type: typeof(IdGraphType)); // TODO: Field(x => x.CreatedByUser, type: typeof(UserType)); Field(x => x.ModifiedByUserId, type: typeof(IdGraphType)); // TODO: Field(x => x.ModifiedByUser, type: typeof(UserType)); }
public UnitOfWork(EMSDbContext context, IPropertyMappingService propertyMappingService) { _context = context ?? throw new ArgumentNullException(nameof(context)); Jobs = new JobRepository(context); JobSkills = new JobSkillRepository(context); Skills = new SkillRepository(context, propertyMappingService); Employees = new EmployeeRepository(context); }
/// <summary> /// The constructor of the Job business logic layer. /// </summary> public JobBLL( JobRepository jobRepository, SkillRepository skillRepository, JobSkillRepository jobSkillRepository ) { this.jobRepository = jobRepository; this.skillRepository = skillRepository; this.jobSkillRepository = jobSkillRepository; }
/// <summary> /// The constructor of the Skill business logic layer. /// </summary> public SkillBLL( SkillRepository skillRepository, ResumeRepository resumeRepository, ResumeSkillRepository resumeSkillRepository, JobRepository jobRepository, JobSkillRepository jobSkillRepository ) { this.skillRepository = skillRepository; this.resumeRepository = resumeRepository; this.resumeSkillRepository = resumeSkillRepository; this.jobRepository = jobRepository; this.jobSkillRepository = jobSkillRepository; }
public SkillType( SkillAliasRepository skillAliasRepository, SkillRepository skillRepository, ResumeRepository resumeRepository, ResumeSkillRepository resumeSkillRepository, JobRepository jobRepository, JobSkillRepository jobSkillRepository ) { Field(x => x.Id, type: typeof(IdGraphType)); Field(x => x.Name); Field(x => x.DisplayName); Field(x => x.Description, nullable: true); Field <ListGraphType <SkillAliasType> >( "skillAliases", resolve: context => skillAliasRepository.GetBySkillId(context.Source.Id) ); //// Async test //FieldAsync<ListGraphType<SkillAliasType>>( // "skillAliases", // resolve: async context => // { // return await context.TryAsyncResolve( // async c => await skillAliasRepository.GetBySkillIdAsync(context.Source.Id) // ); // } //); Field <ListGraphType <ResumeType> >( "resumes", resolve: context => resumeRepository.GetBySkillId(context.Source.Id) ); //// Async test //FieldAsync<ListGraphType<ResumeType>>( // "resumes", // resolve: async context => // { // return await context.TryAsyncResolve( // async c => await resumeRepository.GetBySkillIdAsync(context.Source.Id) // ); // } //); Field <ListGraphType <JobType> >( "jobs", resolve: context => jobRepository.GetBySkillId(context.Source.Id) ); //// Async test //FieldAsync<ListGraphType<JobType>>( // "jobs", // resolve: async context => // { // return await context.TryAsyncResolve( // async c => await jobRepository.GetBySkillIdAsync(context.Source.Id) // ); // } //); Field(x => x.CreatedByUserId, type: typeof(IdGraphType)); // TODO: Field(x => x.CreatedByUser, type: typeof(UserType)); Field(x => x.ModifiedByUserId, type: typeof(IdGraphType)); // TODO: Field(x => x.ModifiedByUser, type: typeof(UserType)); }