public async Task <TagsResponse> DeleteAsync(int id) { var existingTags = await _tagsRepository.FindByIdAsync(id); if (existingTags == null) { return(new TagsResponse("tags not found.")); } try { _tagsRepository.Remove(existingTags); await _unitOfWork.CompleteAsync(); return(new TagsResponse(existingTags)); } catch (Exception ex) { // Do some logging stuff return(new TagsResponse($"An error occurred when deleting the tags: {ex.Message}")); } }
public void Remove(int id) { _tagsRepository.Remove(id); }