public void Remove(Contact contact)
 {
     this.ChechFoNullValue(contact, "Contact");
     this.contacts.Remove(contact);
 }
        private static Phonebook ReadPhonesFromFile(string path)
        {
            var phonebook = new Phonebook();

            using (var reader = new StreamReader(path))
            {
                var line = reader.ReadLine();

                while (line != null)
                {
                    var currentLine = line.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    
                    var contact = new Contact(currentLine[0], currentLine[1], currentLine[2]);
                    
                    phonebook.Add(contact);

                    line = reader.ReadLine();
                }
            }

            return phonebook;
        }
 public void Add(Contact contact)
 {
     this.ChechFoNullValue(contact, "Contact");
     this.contacts.Add(contact);
 }