public async Task Handle(UpdateJobPosition request)
        {
            var entity = await _jobPositionRepository.Get(request.JobPosition.Id.Value);

            entity.Update(request.JobPosition);

            await _unitOfWork.SaveChangesAsync();
        }
예제 #2
0
        public async Task <GetJobPositionResult> Handle(GetJobPosition query)
        {
            var entity = await _jobPositionRepository.Get(query.JobPositionId.Value);

            return(new GetJobPositionResult
            {
                JobPosition = new JobPosition
                {
                    Id = entity.Id,
                    Title = entity.Title,
                    Template = new Template
                    {
                        Description = entity.Template.Description,
                        Questions = entity.Template.Questions.Select(q => q.CreateContractQuestion()).ToArray()
                    }
                }
            });
        }