예제 #1
0
        public async Task <IActionResult> DeleteTool(Guid id)
        {
            var tool = HttpContext.Items["tool"] as Tool;

            _repository.DeleteTool(tool);
            await _unitOfWork.SaveChanges();

            return(NoContent());
        }
예제 #2
0
        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());
        }