public int Delete(int id) { var recordToDelete = _contactsRepo.FindOne(id); if (recordToDelete != null) { return(_contactsRepo.Delete(id)); } return(id); }
public void Exe() { Console.Clear(); ListWorkflow lwf = new ListWorkflow(); lwf.Exe(); Console.WriteLine(ConsoleIO.SeparationBar); Console.WriteLine("Select ID to remove"); int id = Convert.ToInt32(Console.ReadLine()); contactsRepository.Delete(id); Contacts removedContact = contactsRepository.GetById(2); if (removedContact == null) { Console.WriteLine("Record already removed..."); } lwf.Exe(); }