Esempio n. 1
0
        public virtual async Task UpdateJobPost(JobPostEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

            var entity = await _jobPostRepository.GetAsync(input.Id.Value);

            input.MapTo(entity);

            await _jobPostRepository.UpdateAsync(entity);
        }
Esempio n. 2
0
        public virtual async Task <JobPostEditDto> CreateJobPost(JobPostEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增
            var entity = input.MapTo <JobPost>();

            entity.PublishDate = DateTime.Now;
            entity             = await _jobPostRepository.InsertAsync(entity);

            return(entity.MapTo <JobPostEditDto>());
        }