public async Task <IActionResult> DeleteTool(Guid id) { var tool = HttpContext.Items["tool"] as Tool; _repository.DeleteTool(tool); await _unitOfWork.SaveChanges(); return(NoContent()); }
public async Task <IActionResult> DeleteTool(Guid toolID) { if (!await _toolRepository.ToolExistAsync(toolID)) { return(NotFound()); } var tool = await _toolRepository.GetToolAsync(toolID); _toolRepository.DeleteTool(tool); await _toolRepository.SaveAsync(); return(Ok()); }