public async Task <IActionResult> UpdateEmployeeTask([FromRoute] Guid taskId, JsonPatchDocument <EmployeeTaskUpdateDto> patchTasks)
        {
            var taskEntity = await _employeeTaskRepository.GetOneTaskAsync(taskId);

            //查出来的是EmployeeTask类型,要转换成EmployeeTaskUpdateDto
            var dtoToPatch = _mapper.Map <EmployeeTaskUpdateDto>(taskEntity);

            //用JsonPatchDocument转化一下Jason Patch操作,相当于把输入的patchTask转换成EmployeeTaskUpdateDto, ModelState返回false如果验证有错误,这里可以空着
            patchTasks.ApplyTo(dtoToPatch, ModelState);

            //处理验证
            if (!TryValidateModel(dtoToPatch))
            {
                return(ValidationProblem(ModelState));
            }
            ;

            //这里要把输入对象转换成目标对象,因为要存进数据库,所以目标类型是EmployeeTask,目标就是taskEntity,CreateMap<EmployeeTaskUpdateDto, EmployeeTask>();
            _mapper.Map(dtoToPatch, taskEntity);
            //更新task的employeeId的时候要确保这个id确实存在,或者为空
            if (!await _employeeRepository.EmployeeExistAsync(taskEntity.EmployeeId) && taskEntity.EmployeeId != null)
            {
                return(NotFound());
            }

            _employeeTaskRepository.UpdateTask(taskEntity);
            await _employeeTaskRepository.SaveAsync();

            return(NoContent());
        }