private void ClearDb() { foreach (var item in _repo.GetAll()) { _repo.Delete(item.Id); } }
private static void DeleteItem() { var todos = Repo.GetAll().ToList(); TodoHelper.PrintTodoTable(todos); Console.Write("Enter the Todo item number to delete: "); var response = Console.ReadLine(); if (int.TryParse(response, out var choice)) { if (choice > 0 && choice <= todos.Count()) { Repo.Delete(todos.ElementAt(choice - 1).Id); } else { Console.WriteLine("Invalid Choice! Try Again!!!\n\n"); } } }
public ActionResult <IEnumerable <Todo> > Get() { return(Ok(_tr.GetAll())); }
internal IEnumerable <Todo> GetAll() { return(_repo.GetAll()); }