public async Task <IActionResult> Removecounter(int id) { var counter = await counterRepository.GetOne(id); if (counter == null) { return(NotFound()); } counterRepository.Remove(counter); if (await unitOfWork.CompleteAsync() == false) { throw new Exception(message: $"Deleting counter failed"); } return(Ok($"{id}")); }