/// <summary>
        /// The constructor of the Document business logic layer.
        /// </summary>
        public DocumentBLL(
            IConfiguration configuration,
            ILogger <DocumentBLL> logger,
            IHttpContextAccessor httpContextAccessor,
            UserManager <User> userManager,
            FileService fileService,
            RabbitMQService rabbitMQService,
            DocumentRepository documentRepository,
            DocumentTypeRepository documentTypeRepository,
            ResumeBLL resumeBLL,
            ResumeRepository resumeRepository,
            DocumentResumeRepository documentResumeRepository
            )
        {
            this.configuration       = configuration;
            this.logger              = logger;
            this.httpContextAccessor = httpContextAccessor;

            this.userManager     = userManager;
            this.fileService     = fileService;
            this.rabbitMQService = rabbitMQService;

            this.documentRepository     = documentRepository;
            this.documentTypeRepository = documentTypeRepository;

            this.resumeBLL                = resumeBLL;
            this.resumeRepository         = resumeRepository;
            this.documentResumeRepository = documentResumeRepository;
        }
Beispiel #2
0
        /// <summary>
        /// The constructor of the Resume business logic layer.
        /// </summary>
        public ResumeBLL(
            IConfiguration configuration,
            ILogger <DocumentBLL> logger,
            IHttpContextAccessor httpContextAccessor,
            UserManager <User> userManager,
            ResumeRepository resumeRepository,
            ResumeStateRepository resumeStateRepository,
            ResumeSkillRepository resumeSkillRepository,
            DocumentResumeRepository documentResumeRepository,
            DocumentRepository documentRepository,
            SkillRepository skillRepository
            )
        {
            this.configuration       = configuration;
            this.logger              = logger;
            this.httpContextAccessor = httpContextAccessor;
            this.userManager         = userManager;

            this.resumeRepository      = resumeRepository;
            this.resumeStateRepository = resumeStateRepository;
            this.resumeSkillRepository = resumeSkillRepository;

            this.documentResumeRepository = documentResumeRepository;
            this.documentRepository       = documentRepository;

            this.skillRepository = skillRepository;
        }
Beispiel #3
0
        public ResumeType(
            ResumeStateRepository resumeStateRepository,
            ResumeRepository resumeRepository,
            DocumentRepository documentRepository,
            DocumentResumeRepository documentResumeRepository,
            SkillRepository skillRepository,
            ResumeSkillRepository resumeSkillRepository
            )
        {
            Field(x => x.Id, type: typeof(IdGraphType));
            Field(x => x.Name);
            Field(x => x.DisplayName);
            Field(x => x.JobTitle, nullable: true);
            Field(x => x.Description, nullable: true);

            Field <ResumeStateType>(
                "resumeState",
                resolve: context =>
            {
                if (context.Source.ResumeStateId != null)
                {
                    return(resumeStateRepository.GetById((Guid)context.Source.ResumeStateId));
                }
                return(null);
            }
                );

            //// Async test
            //FieldAsync<ResumeStateType>(
            //    "resumeState",
            //    resolve: async context =>
            //    {
            //        if (context.Source.ResumeStateId != null) {
            //            return await context.TryAsyncResolve(
            //                async c => await resumeStateRepository.GetByIdAsync((Guid)context.Source.ResumeStateId)
            //            );
            //        }
            //
            //        return null;
            //    }
            //);

            Field <ListGraphType <DocumentType> >(
                "documents",
                resolve: context => documentRepository.GetByResumeId(context.Source.Id)
                );

            //// Async test
            //FieldAsync<ListGraphType<DocumentType>>(
            //    "documents",
            //    resolve: async context =>
            //    {
            //        return await context.TryAsyncResolve(
            //            async c => await documentRepository.GetByResumeIdAsync(context.Source.Id)
            //        );
            //    }
            //);

            Field <ListGraphType <SkillType> >(
                "skills",
                resolve: context => skillRepository.GetByResumeId(context.Source.Id)
                );

            //// Async test
            //FieldAsync<ListGraphType<SkillType>>(
            //    "skills",
            //    resolve: async context =>
            //    {
            //        return await context.TryAsyncResolve(
            //            async c => await skillRepository.GetByResumeIdAsync(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 DocumentType(
            DocumentTypeRepository documentTypeRepository,
            DocumentRepository documentRepository,
            ResumeRepository resumeRepository,
            DocumentResumeRepository documentResumeRepository
            )
        {
            Field(x => x.Id, type: typeof(IdGraphType));
            Field(x => x.Name);
            Field(x => x.DisplayName, nullable: true);
            Field(x => x.Description, nullable: true);
            Field(x => x.Path, nullable: true);
            Field(x => x.URL, nullable: true);
            Field(x => x.SizeInBytes, nullable: true);
            Field(x => x.FileLastModifiedOn, nullable: true);
            Field(x => x.MimeType, nullable: true);

            Field <DocumentTypeType>(
                "documentType",
                resolve: context =>
            {
                if (context.Source.DocumentTypeId != null)
                {
                    return(documentTypeRepository.GetById((Guid)context.Source.DocumentTypeId));
                }
                return(null);
            }
                );

            //// Async test
            //FieldAsync<DocumentTypeType>(
            //    "documentType",
            //    resolve: async context =>
            //    {
            //        if (context.Source.DocumentTypeId != null) {
            //            return await context.TryAsyncResolve(
            //                async c => await documentTypeRepository.GetByIdAsync((Guid)context.Source.DocumentTypeId)
            //            );
            //        }
            //
            //        return null;
            //    }
            //);

            Field <ListGraphType <ResumeType> >(
                "resumes",
                resolve: context => resumeRepository.GetByDocumentId(context.Source.Id)
                );

            //// Async test
            //FieldAsync<ListGraphType<ResumeType>>(
            //    "resumes",
            //    resolve: async context =>
            //    {
            //        return await context.TryAsyncResolve(
            //            async c => await resumeRepository.GetByDocumentIdAsync(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 DocumentResumeType(
            DocumentRepository documentRepository,
            ResumeRepository resumeRepository,
            DocumentResumeRepository documentResumeRepository
            )
        {
            Field(x => x.Id, type: typeof(IdGraphType));

            Field <DocumentType>(
                "document",
                resolve: context =>
            {
                if (context.Source.DocumentId != null)
                {
                    return(documentRepository.GetById((Guid)context.Source.DocumentId));
                }
                return(null);
            }
                );

            //// Async test
            //FieldAsync<DocumentType>(
            //    "document",
            //    resolve: async context =>
            //    {
            //        if (context.Source.DocumentId != null) {
            //            return await context.TryAsyncResolve(
            //                async c => await documentRepository.GetByIdAsync((Guid)context.Source.DocumentId)
            //            );
            //        }
            //
            //        return null;
            //    }
            //);

            Field <ResumeType>(
                "resume",
                resolve: context =>
            {
                if (context.Source.ResumeId != null)
                {
                    return(resumeRepository.GetById((Guid)context.Source.ResumeId));
                }
                return(null);
            }
                );

            //// Async test
            //FieldAsync<ResumeType>(
            //    "resume",
            //    resolve: async context =>
            //    {
            //        if (context.Source.ResumeId != null) {
            //            return await context.TryAsyncResolve(
            //                async c => await resumeRepository.GetByIdAsync((Guid)context.Source.ResumeId)
            //            );
            //        }
            //
            //        return null;
            //    }
            //);

            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));
        }