Exemple #1
0
 private void ClearDb()
 {
     foreach (var item in _repo.GetAll())
     {
         _repo.Delete(item.Id);
     }
 }
Exemple #2
0
        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");
                }
            }
        }
Exemple #3
0
 public ActionResult <IEnumerable <Todo> > Get()
 {
     return(Ok(_tr.GetAll()));
 }
 internal IEnumerable <Todo> GetAll()
 {
     return(_repo.GetAll());
 }