public IActionResult Patch([FromRoute] Guid id, [FromBody] SamplePatchUpdateDto patchUpateDto) { var entity = _service.PatchSample(id, patchUpateDto); _unitOfWork.Save(); return(Ok(entity)); }
/// <summary> /// 部分更新一条示例数据 /// </summary> /// <param name="id">主键</param> /// <param name="dto">实体</param> /// <returns>实体</returns> public SampleUpdateDto PatchSample(Guid id, SamplePatchUpdateDto dto) { //事务测试 var entity = _repository.Update(id, dto); return(Mapper.Map <SampleUpdateDto>(entity)); }