Esempio n. 1
0
        public CurriculumVitaeQuery(ICurriculumVitaeRepository repository)
        {
            Name = "root";

            Field <ListGraphType <CompanyType> >(
                "companies",
                "Companies the user has worked for",
                resolve: context => repository.GetCompanies());

            Field <CompanyType>(
                "company",
                "Specific company the user has worked for",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "id", Description = "Id of the company"
            }),
                resolve: context => repository.GetCompanyById(context.GetArgument <int>("id")));

            Field <ListGraphType <EducationType> >(
                "educations",
                "Educations the user has acquired",
                resolve: context => repository.GetEducations());

            Field <EducationType>(
                "education",
                "Specific education the user has acquired",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "id", Description = "Id of the education"
            }),
                resolve: context => repository.GetEducationById(context.GetArgument <int>("id")));

            Field <ListGraphType <ProjectType> >(
                "projects",
                "Projects the user has participated in",
                resolve: context => repository.GetProjects());

            Field <ProjectType>(
                "project",
                "Specific project the user has participated in",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "id", Description = "Id of the project"
            }),
                resolve: context => repository.GetProjectById(context.GetArgument <int>("id")));

            Field <ListGraphType <SkillType> >(
                "skills",
                "Skills the user has aquired during his work life",
                resolve: context => repository.GetSkills());

            Field <SkillType>(
                "skill",
                "Specific skill the user has acquired during his work life",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "id", Description = "Id of the skill"
            }),
                resolve: context => repository.GetSkillById(context.GetArgument <int>("id")));
        }
Esempio n. 2
0
        public SkillLevelType(ICurriculumVitaeRepository repository)
        {
            Name        = "SkillLevel";
            Description = "User's proficiency of a skill.";

            AddValue("Beginner", "Beginner proficiency", SkillLevel.Beginner);
            AddValue("Intermediate", "Intermediate proficiency", SkillLevel.Intermediate);
            AddValue("Expert", "Expert proficiency", SkillLevel.Expert);
        }
Esempio n. 3
0
        public ProjectType(ICurriculumVitaeRepository repository)
        {
            Name = "Project";

            Field(t => t.Id).Description("Id of the project");
            Field(t => t.Name).Description("Name of the project");
            Field <CompanyType>("company", "Company where the project took place",
                                resolve: context => repository.GetCompanyById(context.Source.CompanyId));
            Field <ListGraphType <SkillType> >("skillsUsed", "Skills used on the project",
                                               resolve: context => repository.GetSkillsUsedOnProject(context.Source.Id));
        }
Esempio n. 4
0
        public CompanyType(ICurriculumVitaeRepository repository)
        {
            Name = "Company";

            Field(t => t.Id).Description("Id of the company");
            Field(t => t.Name).Description("Name of the company");
            Field <ListGraphType <ProjectType> >("projects", "Projects made in the company",
                                                 resolve: context => repository.GetProjectsMadeInCompany(context.Source.Id));
            Field <ListGraphType <SkillType> >("skillsUsed", "Skills used accross projects in the company",
                                               resolve: context => repository.GetSkillsUsedInCompany(context.Source.Id));
        }
Esempio n. 5
0
        public SkillType(ICurriculumVitaeRepository repository)
        {
            Name = "Skill";

            Field(t => t.Id).Description("Id of the skill");
            Field(t => t.Name).Description("Name of the skill");
            Field <SkillLevelType>("level", "User's proficiency of the skill");
            Field <ListGraphType <ProjectType> >("usedOnProjects", "Projects where the skills have been used",
                                                 resolve: context => repository.GetProjectsWhereSkillWasUsed(context.Source.Id));
            Field <ListGraphType <CompanyType> >("usedInCompanies", "Companies where the skills have been used",
                                                 resolve: context => repository.GetCompaniesWhereSkillWasUsed(context.Source.Id));
        }
Esempio n. 6
0
 public CurriculumVitaeService(ILoggingService loggingService, IUserRepository userRepository,
                               IProfileRepository profileRepository, IExperienceRepository experienceRepository,
                               ICourseRepository courseRepository, ISkillRepository skillRepository, IAwardRepository awardRepository,
                               IInterestRepository interestRepository, IProjectRepository projectRepository,
                               ICurriculumVitaeRepository curriculumVitaeRepository)
 {
     _loggingService            = loggingService;
     _userRepository            = userRepository;
     _profileRepository         = profileRepository;
     _experienceRepository      = experienceRepository;
     _courseRepository          = courseRepository;
     _skillRepository           = skillRepository;
     _awardRepository           = awardRepository;
     _interestRepository        = interestRepository;
     _projectRepository         = projectRepository;
     _curriculumVitaeRepository = curriculumVitaeRepository;
 }