public void DeleteTools(int toolsId) { var tools = toolsRepository.GetById(toolsId); if (tools.ToolsId == 0) { return; //throw exception aqui !!! } toolsRepository.Delete(tools); }
public async Task <IActionResult> DeleteToolState(int id) { var toolStateFromRepo = await _repo.GetCurrentToolState(id); _repo.Delete(toolStateFromRepo); if (await _repo.SaveAll()) { return(Ok()); } return(BadRequest("Failed to delete the tool state")); }
public Tool Delete(long id) { return(toolsRepository.Delete(id)); }