public async Task <NoteCategoryDTO> UpdateAsync(string id, UpdateNoteCategoryDTO dto) { var item = await _repository.GetItemAsync(id); if (item == null) { throw new NotFoundException("Category not found."); } _mapper.Map(dto, item); var updatedItem = await _repository.UpdateItemAsync(id, item); return(_mapper.Map <NoteCategoryDTO>(updatedItem)); }
public async Task <ActionResult <NoteCategoryDTO> > PutAsync(string id, [FromBody] UpdateNoteCategoryDTO dto) { var item = await _categoryService.UpdateAsync(id, dto); return(Ok(item)); }