using System.Collections.Generic;
public static void Main()
PhoneBook pb = new PhoneBook();
private List<Contact> _Contacts = new List<Contact>() {
new Contact { MobileNumber = 09771400137, Name = "Nigel Anthony Olvieros" },
new Contact { MobileNumber = 14143114, Name = "John Doe" },
new Contact { MobileNumber = 431414123, Name = "Jay Col" },
public IEnumerable<Contact> Contacts { get { return this._Contacts; } }
public void GetAllContacts()
foreach(Contact contact in _Contacts)
Console.WriteLine($"Name : {contact.Name } \n Number : {contact.MobileNumber} \n\n\n");
public void AddContact (Contact contact)
Console.WriteLine($"{contact.Name} successfully added!");
public class Contact: IContact
public long MobileNumber {get;set;}
public string Name {get;set;}
Console.WriteLine($"Calling {this.Name} ....");
public interface IContact : IIntercom
public long MobileNumber {get;set;}
public interface IIntercom