public async Task <bool> UpdateBookInfo(Guid id, UpdateBookInfoDto model, string fields) { var bookInfo = await _service.Query(id, false); bookInfo.UpdateTime = DateTime.Now; return(await _service.Update(CommonClass.SetModelValue(model, bookInfo, fields))); }
public async Task <IActionResult> UpdateBookInfo(Guid id, [FromBody] UpdateBookInfoDto model, [FromQuery] string fields) { try { var result = await _bookInfoManager.UpdateBookInfo(id, model, fields); if (!result) { return(Ok(new JsonMessageResult("Fail", 0, null))); } return(NoContent()); } catch (Exception e) { _logger.LogError(e, e.Message); return(Ok(new JsonMessageResult(e.Message, 0, null))); } }